kubelatte-ce
Форк от sbertech/kubelatte-ce
96 строк · 2.9 Кб
1package v1alpha1
2
3import (
4metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
5)
6
7type LogStatus string
8
9const (
10SuccessStatus LogStatus = "Success"
11FailedStatus LogStatus = "Failed"
12)
13
14type Phase string
15
16const (
17Pending Phase = "Pending"
18Running Phase = "Running"
19Waiting Phase = "Waiting"
20Failed Phase = "Failed"
21Unknown Phase = "Unknown"
22)
23
24type ConditionType string
25
26const (
27UpdateConfigMap ConditionType = "UpdateConfigMap"
28CheckAnnotationAndLabel ConditionType = "CheckAnnotationAndLabel"
29CorrectnessOfConfigs ConditionType = "CorrectnessOfConfigs"
30LastHandledHash ConditionType = "LastHandledHash"
31)
32
33type ConditionStatus string
34
35const (
36ConditionTrue ConditionStatus = "True"
37ConditionFalse ConditionStatus = "False"
38ConditionUnknown ConditionStatus = "Unknown"
39)
40
41type Condition struct {
42Type ConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=ConditionType"`
43Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=ConditionStatus"`
44LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"`
45Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"`
46}
47
48type SearchStatus string
49
50const (
51Found SearchStatus = "Found"
52NotFound SearchStatus = "Not Found"
53)
54
55type Annotation struct {
56Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=type"`
57Containers []string `json:"containers,omitempty"`
58InitContainers []string `json:"initContainers,omitempty"`
59}
60
61type Label struct {
62Name []string `json:"name,omitempty" protobuf:"bytes,1,opt,name=type"`
63Containers []string `json:"containers,omitempty"`
64InitContainers []string `json:"initContainers,omitempty"`
65}
66
67type ContainerInfo struct {
68Name string `json:"name" protobuf:"bytes,1,opt,name=type"`
69Status SearchStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=SearchStatus"`
70}
71
72type LabelAndAnnotationNotFound struct {
73Containers []string `json:"containers,omitempty"`
74InitContainers []string `json:"initContainers,omitempty"`
75}
76
77type LabelAndAnnotationInfo struct {
78LabelAndAnnotationNotFound LabelAndAnnotationNotFound `json:"labelAndAnnotationNotFound,omitempty"`
79Annotations []Annotation `json:"annotations,omitempty"`
80Labels []Label `json:"labels,omitempty"`
81}
82
83// +kubebuilder:pruning:PreserveUnknownFields
84type ResourceStatus struct {
85Name string `json:"name,omitempty"`
86Kind string `json:"kind,omitempty"`
87ApiVersion string `json:"apiVersion,omitempty"`
88Message string `json:"message,omitempty"`
89Phase string `json:"phase,omitempty"`
90Status string `json:"status,omitempty"`
91}
92
93// +kubebuilder:object:generate=false
94type Namespaced interface {
95GetNamespacedName() string
96}
97