garm/runner/providers/external/util.go
Gabriel Adrian Samfira 72f45bba47 Remove unused code
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-07-24 07:14:29 +00:00

21 lines
735 B
Go

package external
import (
commonParams "github.com/cloudbase/garm-provider-common/params"
)
// IsProviderValidStatus checks if the given status is valid for the provider.
// A provider should only return a status indicating that the instance is in a
// lifecycle state that it can influence. The sole purpose of a provider is to
// manage the lifecycle of an instance. Statuses that indicate an instance should
// be created or removed, will be set by the controller.
func IsValidProviderStatus(status commonParams.InstanceStatus) bool {
switch status {
case commonParams.InstanceRunning, commonParams.InstanceError,
commonParams.InstanceStopped, commonParams.InstanceStatusUnknown:
return true
default:
return false
}
}