mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
chore: add dynamic parameter error if missing metadata from provisioner (#17809)
This commit is contained in:
@ -95,6 +95,7 @@ type Options struct {
|
||||
}
|
||||
|
||||
type server struct {
|
||||
apiVersion string
|
||||
// lifecycleCtx must be tied to the API server's lifecycle
|
||||
// as when the API server shuts down, we want to cancel any
|
||||
// long-running operations.
|
||||
@ -153,7 +154,9 @@ func (t Tags) Valid() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func NewServer(lifecycleCtx context.Context,
|
||||
func NewServer(
|
||||
lifecycleCtx context.Context,
|
||||
apiVersion string,
|
||||
accessURL *url.URL,
|
||||
id uuid.UUID,
|
||||
organizationID uuid.UUID,
|
||||
@ -214,6 +217,7 @@ func NewServer(lifecycleCtx context.Context,
|
||||
|
||||
s := &server{
|
||||
lifecycleCtx: lifecycleCtx,
|
||||
apiVersion: apiVersion,
|
||||
AccessURL: accessURL,
|
||||
ID: id,
|
||||
OrganizationID: organizationID,
|
||||
@ -1536,10 +1540,11 @@ func (s *server) CompleteJob(ctx context.Context, completed *proto.CompletedJob)
|
||||
}
|
||||
|
||||
err = s.Database.InsertTemplateVersionTerraformValuesByJobID(ctx, database.InsertTemplateVersionTerraformValuesByJobIDParams{
|
||||
JobID: jobID,
|
||||
UpdatedAt: now,
|
||||
CachedPlan: plan,
|
||||
CachedModuleFiles: fileID,
|
||||
JobID: jobID,
|
||||
UpdatedAt: now,
|
||||
CachedPlan: plan,
|
||||
CachedModuleFiles: fileID,
|
||||
ProvisionerdVersion: s.apiVersion,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("insert template version terraform data: %w", err)
|
||||
|
Reference in New Issue
Block a user