MCPcopy Create free account
hub / github.com/cloudbase/garm / SetInstanceToPendingDelete

Method SetInstanceToPendingDelete

runner/agent.go:51–67  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

49}
50
51func (r *Runner) SetInstanceToPendingDelete(ctx context.Context) error {
52 instance, err := auth.InstanceParams(ctx)
53 if err != nil {
54 slog.With(slog.Any("error", err)).ErrorContext(
55 ctx, "failed to get instance params")
56 return runnerErrors.ErrUnauthorized
57 }
58
59 updateParams := params.UpdateInstanceParams{
60 Status: commonParams.InstancePendingDelete,
61 }
62
63 if _, err := r.store.ForceUpdateInstance(r.ctx, instance.ID, updateParams); err != nil {
64 return fmt.Errorf("failed to set instance to pending_delete: %w", err)
65 }
66 return nil
67}
68
69func (r *Runner) GetAgentJWTToken(ctx context.Context, runnerName string) (string, error) {
70 var instance params.Instance

Callers

nothing calls this directly

Calls 2

InstanceParamsFunction · 0.92
ForceUpdateInstanceMethod · 0.65

Tested by

no test coverage detected