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

Function validateInstanceState

runner/metadata.go:81–92  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

79`
80
81func validateInstanceState(ctx context.Context) (params.Instance, error) {
82 status := auth.InstanceRunnerStatus(ctx)
83 if status != params.RunnerPending && status != params.RunnerInstalling {
84 return params.Instance{}, runnerErrors.ErrUnauthorized
85 }
86
87 instance, err := auth.InstanceParams(ctx)
88 if err != nil {
89 return params.Instance{}, runnerErrors.ErrUnauthorized
90 }
91 return instance, nil
92}
93
94func (r *Runner) getServiceNameForEntity(entity params.ForgeEntity) (string, error) {
95 switch entity.EntityType {

Callers 6

GetInstanceMetadataMethod · 0.85
GetJITConfigFileMethod · 0.85
GetAgentGARMToolsMethod · 0.85
ShowGARMToolsMethod · 0.85

Calls 2

InstanceRunnerStatusFunction · 0.92
InstanceParamsFunction · 0.92

Tested by 1