/
types.go
57 lines (49 loc) · 2.21 KB
/
types.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package kubeconfig
// KubeConfigValue is a struct used to create a kubectl configuration YAML file.
type KubeConfigValue struct {
APIVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`
Clusters []KubeconfigNamedCluster `yaml:"clusters"`
Users []KubeconfigUser `yaml:"users"`
Contexts []KubeconfigNamedContext `yaml:"contexts"`
CurrentContext string `yaml:"current-context"`
Preferences struct{} `yaml:"preferences"`
}
// KubeconfigUser is a struct used to create a kubectl configuration YAML file
type KubeconfigUser struct {
Name string `yaml:"name"`
User KubeconfigUserKeyPair `yaml:"user"`
}
// KubeconfigUserKeyPair is a struct used to create a kubectl configuration YAML file
type KubeconfigUserKeyPair struct {
ClientCertificateData string `yaml:"client-certificate-data"`
ClientKeyData string `yaml:"client-key-data"`
AuthProvider KubeconfigAuthProvider `yaml:"auth-provider,omitempty"`
}
// KubeconfigAuthProvider is a struct used to create a kubectl authentication provider
type KubeconfigAuthProvider struct {
Name string `yaml:"name"`
Config map[string]string `yaml:"config"`
}
// KubeconfigNamedCluster is a struct used to create a kubectl configuration YAML file
type KubeconfigNamedCluster struct {
Name string `yaml:"name"`
Cluster KubeconfigCluster `yaml:"cluster"`
}
// KubeconfigCluster is a struct used to create a kubectl configuration YAML file
type KubeconfigCluster struct {
Server string `yaml:"server"`
CertificateAuthorityData string `yaml:"certificate-authority-data"`
CertificateAuthority string `yaml:"certificate-authority"`
}
// KubeconfigNamedContext is a struct used to create a kubectl configuration YAML file
type KubeconfigNamedContext struct {
Name string `yaml:"name"`
Context KubeconfigContext `yaml:"context"`
}
// KubeconfigContext is a struct used to create a kubectl configuration YAML file
type KubeconfigContext struct {
Cluster string `yaml:"cluster"`
Namespace string `yaml:"namespace,omitempty"`
User string `yaml:"user"`
}