Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 62 additions & 14 deletions pkg/devspace/config/versions/adjust.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,74 @@ import (
)

func adjustConfig(config *latest.Config) error {
for name, v := range config.Vars {
v.Name = name
if config.Vars != nil {
newObjs := map[string]*latest.Variable{}
for name, v := range config.Vars {
if v == nil {
continue
}
v.Name = name
newObjs[name] = v
}
config.Vars = newObjs
}
for name, command := range config.Commands {
command.Name = name
if config.Commands != nil {
newObjs := map[string]*latest.CommandConfig{}
for name, command := range config.Commands {
if command == nil {
continue
}
command.Name = name
newObjs[name] = command
}
config.Commands = newObjs
}
for name, pullSecret := range config.PullSecrets {
pullSecret.Name = name
if config.PullSecrets != nil {
newObjs := map[string]*latest.PullSecretConfig{}
for name, pullSecret := range config.PullSecrets {
if pullSecret == nil {
continue
}
pullSecret.Name = name
newObjs[name] = pullSecret
}
config.PullSecrets = newObjs
}
for name, devPod := range config.Dev {
devPod.Name = name
for c, v := range devPod.Containers {
v.Container = c
if config.Dev != nil {
newObjs := map[string]*latest.DevPod{}
for name, devPod := range config.Dev {
if devPod == nil {
continue
}
devPod.Name = name
for c, v := range devPod.Containers {
v.Container = c
}
newObjs[name] = devPod
}
config.Dev = newObjs
}
for name, pipeline := range config.Pipelines {
pipeline.Name = name
if config.Pipelines != nil {
newObjs := map[string]*latest.Pipeline{}
for name, pipeline := range config.Pipelines {
if pipeline == nil {
continue
}
pipeline.Name = name
newObjs[name] = pipeline
}
config.Pipelines = newObjs
}
for name, dep := range config.Dependencies {
dep.Name = name
if config.Dependencies != nil {
newObjs := map[string]*latest.DependencyConfig{}
for name, dep := range config.Dependencies {
if dep == nil {
continue
}
dep.Name = name
newObjs[name] = dep
}
config.Dependencies = newObjs
}
if config.Images != nil {
newObjs := map[string]*latest.Image{}
Expand Down