/
loggingcluster_types.go
65 lines (54 loc) · 2.13 KB
/
loggingcluster_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
package v1beta1
import (
opnimeta "github.com/rancher/opni/pkg/util/meta"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type IndexUserState string
const (
IndexUserStatePending IndexUserState = "pending"
IndexUserStateCreated IndexUserState = "created"
IndexUserStateError IndexUserState = "error"
)
type LoggingClusterState string
const (
LoggingClusterStateCreated LoggingClusterState = "created"
LoggingClusterStateRegistered LoggingClusterState = "registered"
LoggingClusterStateError LoggingClusterState = "error"
)
const (
IDLabel = "opni.io/multiclusterID"
)
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
// +kubebuilder:printcolumn:name="IndexUser",type=boolean,JSONPath=`.status.indexUserState`
type LoggingCluster struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec LoggingClusterSpec `json:"spec,omitempty"`
Status LoggingClusterStatus `json:"status,omitempty"`
}
type LoggingClusterSpec struct {
OpensearchClusterRef *opnimeta.OpensearchClusterRef `json:"opensearchCluster,omitempty"`
// Deprecated: individual auth users are no longer requried
IndexUserSecret *corev1.LocalObjectReference `json:"indexUser,omitempty"`
FriendlyName string `json:"friendlyName,omitempty"`
LastSync metav1.Time `json:"lastSync,omitempty"`
Enabled bool `json:"enabled,omitempty"`
}
type LoggingClusterStatus struct {
Conditions []string `json:"conditions,omitempty"`
State LoggingClusterState `json:"state,omitempty"`
IndexUserState IndexUserState `json:"indexUserState,omitempty"`
ReadRole string `json:"readRole,omitempty"`
}
// +kubebuilder:object:root=true
type LoggingClusterList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []LoggingCluster `json:"items"`
}
func init() {
SchemeBuilder.Register(&LoggingCluster{}, &LoggingClusterList{})
}