(ctx context.Context, options client.StatusOptions)
| 311 | } |
| 312 | |
| 313 | func (s *proxyClient) Status(ctx context.Context, options client.StatusOptions) (client.Status, error) { |
| 314 | s.m.Lock() |
| 315 | defer s.m.Unlock() |
| 316 | |
| 317 | stdout := &bytes.Buffer{} |
| 318 | buf := &bytes.Buffer{} |
| 319 | err := RunCommandWithBinaries( |
| 320 | ctx, |
| 321 | "status", |
| 322 | s.config.Exec.Proxy.Status, |
| 323 | s.workspace.Context, |
| 324 | s.workspace, |
| 325 | nil, |
| 326 | s.devPodConfig.ProviderOptions(s.config.Name), |
| 327 | s.config, |
| 328 | EncodeOptions(options, DevPodFlagsStatus), |
| 329 | nil, |
| 330 | io.MultiWriter(stdout, buf), |
| 331 | buf, |
| 332 | s.log.ErrorStreamOnly(), |
| 333 | ) |
| 334 | if err != nil { |
| 335 | return client.StatusNotFound, fmt.Errorf("error retrieving container status: %s%w", buf.String(), err) |
| 336 | } |
| 337 | |
| 338 | readLogStream(bytes.NewReader(buf.Bytes()), s.log.ErrorStreamOnly()) |
| 339 | status := &client.WorkspaceStatus{} |
| 340 | err = json.Unmarshal(stdout.Bytes(), status) |
| 341 | if err != nil { |
| 342 | return client.StatusNotFound, fmt.Errorf("error parsing proxy command response: %s%w", stdout.String(), err) |
| 343 | } |
| 344 | |
| 345 | // parse status |
| 346 | return client.ParseStatus(status.State) |
| 347 | } |
| 348 | |
| 349 | func (s *proxyClient) updateInstance(ctx context.Context) error { |
| 350 | err := RunCommandWithBinaries( |
nothing calls this directly
no test coverage detected