mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: Separate the provisionerd server into it's own package (#4940)
* chore: Separate the provisionerd server into it's own package This code should be thoroughly tested now that we understand the abstraction. I separated it to make our lives a bit easier for external provisioner daemons as well! * Add tests * Add workspace builds * Add test for workspace resources
This commit is contained in:
@@ -17,6 +17,7 @@ import (
|
||||
"github.com/coder/coder/coderd/httpapi"
|
||||
"github.com/coder/coder/coderd/httpmw"
|
||||
"github.com/coder/coder/coderd/parameter"
|
||||
"github.com/coder/coder/coderd/provisionerdserver"
|
||||
"github.com/coder/coder/coderd/rbac"
|
||||
"github.com/coder/coder/codersdk"
|
||||
)
|
||||
@@ -261,7 +262,7 @@ func (api *API) postTemplateVersionDryRun(rw http.ResponseWriter, r *http.Reques
|
||||
|
||||
// Marshal template version dry-run job with the parameters from the
|
||||
// request.
|
||||
input, err := json.Marshal(templateVersionDryRunJob{
|
||||
input, err := json.Marshal(provisionerdserver.TemplateVersionDryRunJob{
|
||||
TemplateVersionID: templateVersion.ID,
|
||||
WorkspaceName: req.WorkspaceName,
|
||||
ParameterValues: parameterValues,
|
||||
@@ -428,7 +429,7 @@ func (api *API) fetchTemplateVersionDryRunJob(rw http.ResponseWriter, r *http.Re
|
||||
}
|
||||
|
||||
// Verify that the template version is the one used in the request.
|
||||
var input templateVersionDryRunJob
|
||||
var input provisionerdserver.TemplateVersionDryRunJob
|
||||
err = json.Unmarshal(job.Input, &input)
|
||||
if err != nil {
|
||||
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
|
||||
|
||||
Reference in New Issue
Block a user