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

Method Stop

pkg/client/clientimplementation/machine_client.go:149–178  ·  view source on GitHub ↗
(ctx context.Context, options client.StopOptions)

Source from the content-addressed store, hash-verified

147}
148
149func (s *machineClient) Stop(ctx context.Context, options client.StopOptions) error {
150 done := printStillRunningLogMessagePeriodically(s.log)
151 defer close(done)
152
153 writer := s.log.Writer(logrus.InfoLevel, false)
154 defer writer.Close()
155
156 s.log.Infof("Stopping machine '%s'...", s.machine.ID)
157 err := RunCommandWithBinaries(
158 ctx,
159 "stop",
160 s.config.Exec.Stop,
161 s.machine.Context,
162 nil,
163 s.machine,
164 s.devPodConfig.ProviderOptions(s.config.Name),
165 s.config,
166 nil,
167 nil,
168 writer,
169 writer,
170 s.log,
171 )
172 if err != nil {
173 return err
174 }
175 s.log.Donef("Successfully stopped '%s'", s.machine.ID)
176
177 return nil
178}
179
180func (s *machineClient) Command(ctx context.Context, commandOptions client.CommandOptions) error {
181 return RunCommandWithBinaries(

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