/
provider.go
32 lines (26 loc) · 938 Bytes
/
provider.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package provider
import (
"fmt"
kube "github.com/threeport/threeport/pkg/kube/v0"
)
const (
// Max length of runtime names prevents infra provider resource names
// exceeding maximum lengths imposed by provider.
RuntimeNameMaxLength = 30
)
// KubernetesRuntimeInfra is the interface each provider has to satisfy to manage
// Kubernetes runtime infra.
type KubernetesRuntimeInfra interface {
Create() (*kube.KubeConnectionInfo, error)
Delete() error
}
// ThreeportRuntimeName returns the name for a Kubernetes runtime that hosts the
// threeport control plane.
func ThreeportRuntimeName(threeportInstanceName string) string {
return fmt.Sprintf("threeport-%s", threeportInstanceName)
}
// ThreeportProviderTags returns the standard tags applied to cloud provider
// infrastructure resources to properly identify them.
func ThreeportProviderTags() map[string]string {
return map[string]string{"ProvisionedBy": "threeport"}
}