opentofu/builtin/providers/rancher/util.go
John Engelman f0dd9b23a3 Closes #11567. Handled Rancher deleted resources. (#11607)
* Fix some spec names.

* Closes #11567 .Handle deleted/purged resources from Rancher.
2017-02-01 19:49:17 +00:00

29 lines
516 B
Go

package rancher
import "github.com/rancher/go-rancher/client"
const (
REMOVED = "removed"
PURGED = "purged"
)
// GetActiveOrchestration get the name of the active orchestration for a environment
func GetActiveOrchestration(project *client.Project) string {
orch := "cattle"
switch {
case project.Swarm:
orch = "swarm"
case project.Mesos:
orch = "mesos"
case project.Kubernetes:
orch = "kubernetes"
}
return orch
}
func removed(state string) bool {
return state == REMOVED || state == PURGED
}