-
Notifications
You must be signed in to change notification settings - Fork 1
/
clusterconfiguration.go
37 lines (30 loc) · 1.15 KB
/
clusterconfiguration.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
33
34
35
36
37
package api
// KubeConfigType kubeconfig type
type KubeConfigType string
// KubeConfigTypeFile file
// KubeConfigTypeRawString rawstring
const (
KubeConfigTypeFile KubeConfigType = "File"
KubeConfigTypeRawString KubeConfigType = "RawString"
KubeConfigTypeInCluster KubeConfigType = "InCluster"
)
// ClusterConfigurationManager clusterconfiguration manager
type ClusterConfigurationManager interface {
// GetAll return all need connect kubernetes cluster
// return clusterconfiguration slice and error
// if first get 3 clusterinfo, such as a, b, c
// second get 2 clusterinfo, such as a, b, will means have one cluster (c) should be shutdown
GetAll() ([]ClusterCfgInfo, error)
}
// ClusterCfgInfo clusterconfiguration info
type ClusterCfgInfo interface {
// GetName return cluster Name
GetName() string
// GetKubeConfigType return kubeconfig type
GetKubeConfigType() KubeConfigType
// GetKubeConfig return kubeconfig such as file path or rawstring, reference KubeConfigType
GetKubeConfig() string
// GetKubeContext return kubeconfig context
// if kubeconfig have multi cluster info, use context choice one cluster connect
GetKubeContext() string
}