Readd the instance status check
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
parent
59ddb4157a
commit
6fc950e513
1 changed files with 6 additions and 0 deletions
|
|
@ -824,6 +824,12 @@ func (r *Runner) ForceDeleteRunner(ctx context.Context, instanceName string) err
|
|||
return errors.Wrap(err, "fetching instance")
|
||||
}
|
||||
|
||||
switch instance.Status {
|
||||
case providerCommon.InstanceRunning, providerCommon.InstanceError:
|
||||
default:
|
||||
return runnerErrors.NewBadRequestError("runner must be in %q or %q state", providerCommon.InstanceRunning, providerCommon.InstanceError)
|
||||
}
|
||||
|
||||
poolMgr, err := r.getPoolManagerFromInstance(ctx, instance)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "fetching pool manager for instance")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue