Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable fromjob source for deploy job variable #3950

Merged
merged 12 commits into from
Jan 23, 2025
Next Next commit
enable fromjob source for deploy job variable
Signed-off-by: Min Min <jamsman94@gmail.com>
jamsman94 committed Jan 8, 2025
commit 63619f1fe0c43fb6acc1b7e4c886acd649a68cb8
Original file line number Diff line number Diff line change
@@ -458,8 +458,9 @@ type DeployModuleInfo struct {
}

type DeployVariableConfig struct {
VariableKey string `bson:"variable_key" json:"variable_key" yaml:"variable_key"`
UseGlobalVariable bool `bson:"use_global_variable" json:"use_global_variable" yaml:"use_global_variable"`
VariableKey string `bson:"variable_key" json:"variable_key" yaml:"variable_key"`
Source string `bson:"source" json:"source" yaml:"source"`
Value string `bson:"value" json:"value" yaml:"value"`
}

type ServiceKeyVal struct {
Original file line number Diff line number Diff line change
@@ -311,6 +311,14 @@ func (j *DeployJob) SetPreset() error {
j.spec.Services = svcResp
}

for _, svc := range j.spec.Services {
for _, cfg := range svc.VariableConfigs {
if cfg.Source == "" {
cfg.Source = "runtime"
}
}
}

j.job.Spec = j.spec
return nil
}