mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-10 08:03:08 -06:00
f0dd9b23a3
* Fix some spec names. * Closes #11567 .Handle deleted/purged resources from Rancher.
29 lines
516 B
Go
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
|
|
}
|