forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
100 lines (92 loc) · 3.63 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
package add_kubernetes_metadata
type ObjectMeta struct {
Annotations map[string]string `json:"annotations"`
CreationTimestamp string `json:"creationTimestamp"`
DeletionTimestamp string `json:"deletionTimestamp"`
GenerateName string `json:"generateName"`
Labels map[string]string `json:"labels"`
Name string `json:"name"`
Namespace string `json:"namespace"`
OwnerReferences []struct {
APIVersion string `json:"apiVersion"`
Controller bool `json:"controller"`
Kind string `json:"kind"`
Name string `json:"name"`
UID string `json:"uid"`
} `json:"ownerReferences"`
ResourceVersion string `json:"resourceVersion"`
SelfLink string `json:"selfLink"`
UID string `json:"uid"`
}
type Container struct {
Image string `json:"image"`
ImagePullPolicy string `json:"imagePullPolicy"`
Name string `json:"name"`
Ports []ContainerPort `json:"ports"`
Resources struct{} `json:"resources"`
TerminationMessagePath string `json:"terminationMessagePath"`
VolumeMounts []struct {
MountPath string `json:"mountPath"`
Name string `json:"name"`
ReadOnly bool `json:"readOnly"`
} `json:"volumeMounts"`
}
type ContainerPort struct {
Name string `json:"name"`
ContainerPort int64 `json:"containerPort"`
Protocol string `json:"protocol"`
}
type PodSpec struct {
Containers []Container `json:"containers"`
DNSPolicy string `json:"dnsPolicy"`
NodeName string `json:"nodeName"`
RestartPolicy string `json:"restartPolicy"`
SecurityContext struct{} `json:"securityContext"`
ServiceAccount string `json:"serviceAccount"`
ServiceAccountName string `json:"serviceAccountName"`
TerminationGracePeriodSeconds int64 `json:"terminationGracePeriodSeconds"`
}
type PodStatusCondition struct {
LastProbeTime interface{} `json:"lastProbeTime"`
LastTransitionTime string `json:"lastTransitionTime"`
Status string `json:"status"`
Type string `json:"type"`
}
type PodContainerStatus struct {
ContainerID string `json:"containerID"`
Image string `json:"image"`
ImageID string `json:"imageID"`
LastState struct {
Terminated struct {
ContainerID string `json:"containerID"`
ExitCode int64 `json:"exitCode"`
FinishedAt string `json:"finishedAt"`
Reason string `json:"reason"`
StartedAt string `json:"startedAt"`
} `json:"terminated"`
} `json:"lastState"`
Name string `json:"name"`
Ready bool `json:"ready"`
RestartCount int64 `json:"restartCount"`
State struct {
Running struct {
StartedAt string `json:"startedAt"`
} `json:"running"`
} `json:"state"`
}
type PodStatus struct {
Conditions []PodStatusCondition `json:"conditions"`
ContainerStatuses []PodContainerStatus `json:"containerStatuses"`
InitContainerStatuses []PodContainerStatus `json:"initContainerStatuses"`
HostIP string `json:"hostIP"`
Phase string `json:"phase"`
PodIP string `json:"podIP"`
StartTime string `json:"startTime"`
}
type Pod struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
Metadata ObjectMeta `json:"metadata"`
Spec PodSpec `json:"spec"`
Status PodStatus `json:"status"`
}