Skip to content

Commit 3499dc2

Browse files
committed
feat: add pipelines.*.defaultNamespace
1 parent 0cf333e commit 3499dc2

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

cmd/run_pipeline.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ func NewSpecificPipelineCmd(f factory.Factory, globalFlags *flags.GlobalFlags, p
196196
Executes pipeline ` + pipeline.Name + `
197197
#######################################################`,
198198
RunE: func(cobraCmd *cobra.Command, args []string) error {
199+
if pipeline.DefaultNamespace != "" && globalFlags.Namespace == "" {
200+
globalFlags.Namespace = pipeline.DefaultNamespace
201+
}
202+
199203
return cmd.Run(cobraCmd, args, f, "runPipelineCommand")
200204
},
201205
}

pkg/devspace/config/versions/latest/schema.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ type Pipeline struct {
136136
// Name of the pipeline, will be filled automatically
137137
Name string `yaml:"name,omitempty" json:"name,omitempty" jsonschema:"enum=dev,enum=deploy,enum=build,enum=purge,enum=.*" jsonschema_description:"Name of the pipeline, will be filled automatically."`
138138

139+
// DefaultNamespace of the pipeline, if no other namespace is configured
140+
DefaultNamespace string `yaml:"defaultNamespace,omitempty" json:"defaultNamespace,omitempty"`
141+
139142
// Run is the actual shell command that should be executed during this pipeline
140143
Run string `yaml:"run,omitempty" json:"run,omitempty" jsonschema:"required" jsonschema_description:"Run is the actual shell command that should be executed during this pipeline."`
141144

@@ -1234,7 +1237,7 @@ type Terminal struct {
12341237
// DependencyConfig defines the devspace dependency
12351238
type DependencyConfig struct {
12361239
// Name is used internally
1237-
Name string `yaml:"name" json:"name" jsonschema_description:"Name is used internally."`
1240+
Name string `yaml:"name,omitempty" json:"name,omitempty" jsonschema_description:"Name is used internally."`
12381241

12391242
// Source holds the dependency project
12401243
Source *SourceConfig `yaml:",inline" json:",inline" jsonschema_description:"Source holds the dependency project."`

0 commit comments

Comments
 (0)