MCPcopy Index your code
hub / github.com/devspace-sh/devspace / adjustConfig

Function adjustConfig

pkg/devspace/config/versions/adjust.go:9–121  ·  view source on GitHub ↗
(config *latest.Config)

Source from the content-addressed store, hash-verified

7)
8
9func adjustConfig(config *latest.Config) error {
10 if config.Vars != nil {
11 newObjs := map[string]*latest.Variable{}
12 for name, v := range config.Vars {
13 if v == nil {
14 continue
15 }
16 v.Name = name
17 newObjs[name] = v
18 }
19 config.Vars = newObjs
20 }
21 if config.Commands != nil {
22 newObjs := map[string]*latest.CommandConfig{}
23 for name, command := range config.Commands {
24 if command == nil {
25 continue
26 }
27 command.Name = name
28 newObjs[name] = command
29 }
30 config.Commands = newObjs
31 }
32 if config.PullSecrets != nil {
33 newObjs := map[string]*latest.PullSecretConfig{}
34 for name, pullSecret := range config.PullSecrets {
35 if pullSecret == nil {
36 continue
37 }
38 pullSecret.Name = name
39 newObjs[name] = pullSecret
40 }
41 config.PullSecrets = newObjs
42 }
43 if config.Dev != nil {
44 newObjs := map[string]*latest.DevPod{}
45 for name, devPod := range config.Dev {
46 if devPod == nil {
47 continue
48 }
49 devPod.Name = name
50 for c, v := range devPod.Containers {
51 v.Container = c
52 }
53 newObjs[name] = devPod
54 }
55 config.Dev = newObjs
56 }
57 if config.Pipelines != nil {
58 newObjs := map[string]*latest.Pipeline{}
59 for name, pipeline := range config.Pipelines {
60 if pipeline == nil {
61 continue
62 }
63 pipeline.Name = name
64 newObjs[name] = pipeline
65 }
66 config.Pipelines = newObjs

Callers 1

ParseFunction · 0.85

Calls 2

ErrorfMethod · 0.45

Tested by

no test coverage detected