mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: Allow inheriting parameters from previous template_versions when updating a template (#2397)
* WIP: feat: Update templates also updates parameters * Insert params for template version update * Working implementation of inherited params * Add "--always-prompt" flag and logging info
This commit is contained in:
+10
-3
@@ -14,9 +14,9 @@ import (
|
||||
type ParameterScope string
|
||||
|
||||
const (
|
||||
ParameterTemplate ParameterScope = "template"
|
||||
ParameterWorkspace ParameterScope = "workspace"
|
||||
ParameterScopeImportJob ParameterScope = "import_job"
|
||||
ParameterTemplate ParameterScope = "template"
|
||||
ParameterWorkspace ParameterScope = "workspace"
|
||||
ParameterImportJob ParameterScope = "import_job"
|
||||
)
|
||||
|
||||
type ParameterSourceScheme string
|
||||
@@ -78,6 +78,13 @@ type ParameterSchema struct {
|
||||
|
||||
// CreateParameterRequest is used to create a new parameter value for a scope.
|
||||
type CreateParameterRequest struct {
|
||||
// CloneID allows copying the value of another parameter.
|
||||
// The other param must be related to the same template_id for this to
|
||||
// succeed.
|
||||
// No other fields are required if using this, as all fields will be copied
|
||||
// from the other parameter.
|
||||
CloneID uuid.UUID `json:"copy_from_parameter,omitempty" validate:""`
|
||||
|
||||
Name string `json:"name" validate:"required"`
|
||||
SourceValue string `json:"source_value" validate:"required"`
|
||||
SourceScheme ParameterSourceScheme `json:"source_scheme" validate:"oneof=data,required"`
|
||||
|
||||
Reference in New Issue
Block a user