| 79 | ` |
| 80 | |
| 81 | func 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 | |
| 94 | func (r *Runner) getServiceNameForEntity(entity params.ForgeEntity) (string, error) { |
| 95 | switch entity.EntityType { |