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

Method Start

pkg/devspace/devpod/devpod.go:74–101  ·  view source on GitHub ↗
(ctx devspacecontext.Context, devPodConfig *latest.DevPod, options Options)

Source from the content-addressed store, hash-verified

72}
73
74func (d *devPod) Start(ctx devspacecontext.Context, devPodConfig *latest.DevPod, options Options) error {
75 d.m.Lock()
76 if d.cancel != nil {
77 d.m.Unlock()
78 return errors.Errorf("dev pod is already running, please stop it before starting")
79 }
80
81 d.cancelCtx, d.cancel = context.WithCancel(ctx.Context())
82 ctx = ctx.WithContext(d.cancelCtx)
83 d.m.Unlock()
84
85 // log devpod to console if debug
86 if ctx.Log().GetLevel() == logrus.DebugLevel {
87 out, err := yaml.Marshal(devPodConfig)
88 if err == nil {
89 ctx.Log().Debugf("DevPod Config: \n%s\n", string(out))
90 }
91 }
92
93 // start the dev pod
94 err := d.startWithRetry(ctx, devPodConfig, options)
95 if err != nil {
96 d.Stop()
97 return err
98 }
99
100 return nil
101}
102
103func (d *devPod) Err() error {
104 d.m.Lock()

Callers 1

StartMethod · 0.95

Calls 10

startWithRetryMethod · 0.95
StopMethod · 0.95
LockMethod · 0.80
UnlockMethod · 0.80
ContextMethod · 0.65
WithContextMethod · 0.65
LogMethod · 0.65
ErrorfMethod · 0.45
GetLevelMethod · 0.45
DebugfMethod · 0.45

Tested by

no test coverage detected