MCPcopy
hub / github.com/loft-sh/devpod / Start

Method Start

pkg/client/clientimplementation/machine_client.go:118–147  ·  view source on GitHub ↗
(ctx context.Context, options client.StartOptions)

Source from the content-addressed store, hash-verified

116}
117
118func (s *machineClient) Start(ctx context.Context, options client.StartOptions) error {
119 done := printStillRunningLogMessagePeriodically(s.log)
120 defer close(done)
121
122 writer := s.log.Writer(logrus.InfoLevel, false)
123 defer writer.Close()
124
125 s.log.Infof("Starting machine '%s'...", s.machine.ID)
126 err := RunCommandWithBinaries(
127 ctx,
128 "start",
129 s.config.Exec.Start,
130 s.machine.Context,
131 nil,
132 s.machine,
133 s.devPodConfig.ProviderOptions(s.config.Name),
134 s.config,
135 nil,
136 nil,
137 writer,
138 writer,
139 s.log,
140 )
141 if err != nil {
142 return err
143 }
144 s.log.Donef("Successfully started '%s'", s.machine.ID)
145
146 return nil
147}
148
149func (s *machineClient) Stop(ctx context.Context, options client.StopOptions) error {
150 done := printStillRunningLogMessagePeriodically(s.log)

Callers

nothing calls this directly

Calls 7

RunCommandWithBinariesFunction · 0.85
WriterMethod · 0.45
CloseMethod · 0.45
InfofMethod · 0.45
ProviderOptionsMethod · 0.45
DonefMethod · 0.45

Tested by

no test coverage detected