-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
58 lines (52 loc) · 1.49 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
58
package main
/*
apiVersion: v1
kind: Config
current-context: minikube
clusters:
- cluster:
certificate-authority: /Users/gerald/.minikube/ca.crt
server: https://192.168.99.100:8443
name: 192-168-99-100:8443
contexts:
- context:
cluster: 192-168-99-100:8443
namespace: default
user: /192-168-99-100:8443
name: default/192-168-99-100:8443/
preferences: {}
users:
- name: minikube
user:
client-certificate: /Users/gerald/.minikube/client.crt
client-key: /Users/gerald/.minikube/client.key
*/
// KubeconfigObject captures the user's ~/.kube/config file
type KubeconfigObject struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
CurrentContext string `json:"current-context"`
Contexts []ContextObject `json:"contexts"`
Users []interface{} `json:"users"`
Clusters []interface{} `json:"clusters"`
}
// ContextObject represents a single context item
type ContextObject struct {
Name string `json:"name"`
Context NestedContextObject `json:"context"`
}
// NestedContextObject contains the namespace
type NestedContextObject struct {
Cluster string `json:"cluster"`
Namespace string `json:"namespace"`
User string `json:"user"`
}
// Pod is a minimal type for a pod manifest
type Pod struct {
APIVersion string `json:"apiVersion"`
Metadata Metadata `json:"metadata"`
}
// Metadata represents the container for the name
type Metadata struct {
Name string `json:"name"`
}