softplayer-backend/internal/kubernetes/common.go

22 lines
422 B
Go
Raw Normal View History

2024-04-29 18:03:37 +00:00
package kubernetes
import (
"fmt"
proto "git.badhouseplants.net/softplayer/softplayer-go-proto/pkg/environments"
)
type Kubernetes interface {
GetKubernetesName() string
RawKubernetesName() string
}
func GetKubernetes(k8s proto.Kubernetes) (Kubernetes, error) {
switch k8s {
case proto.Kubernetes_KUBERNETES_K3S:
return &K3s{}, nil
default:
return nil, fmt.Errorf("unknown provider: %s", k8s.String())
}
}