/
clusterstate_types.go
58 lines (45 loc) · 1.72 KB
/
clusterstate_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 v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
configv1 "github.com/openshift/api/config/v1"
)
// ClusterStateSpec defines the desired state of ClusterState
type ClusterStateSpec struct {
}
// ClusterStateStatus defines the observed state of ClusterState
type ClusterStateStatus struct {
// LastUpdated is the last time that operator state was updated
LastUpdated *metav1.Time `json:"lastUpdated,omitempty"`
// ClusterOperators contains the state for every cluster operator in the
// target cluster
ClusterOperators []ClusterOperatorState `json:"clusterOperators,omitempty"`
}
// ClusterOperatorState summarizes the status of a single cluster operator
type ClusterOperatorState struct {
// Name is the name of the cluster operator
Name string `json:"name"`
// Conditions is the set of conditions in the status of the cluster operator
// on the target cluster
Conditions []configv1.ClusterOperatorStatusCondition `json:"conditions,omitempty"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ClusterState is the Schema for the clusterstates API
// +k8s:openapi-gen=true
// +kubebuilder:subresource:status
type ClusterState struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ClusterStateSpec `json:"spec,omitempty"`
Status ClusterStateStatus `json:"status,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ClusterStateList contains a list of ClusterState
type ClusterStateList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ClusterState `json:"items"`
}
func init() {
SchemeBuilder.Register(&ClusterState{}, &ClusterStateList{})
}