-
Notifications
You must be signed in to change notification settings - Fork 407
/
eventingbackend_types.go
72 lines (56 loc) · 2.38 KB
/
eventingbackend_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
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// +kubebuilder:validation:Enum=BEB;NATS
type BackendType string
const (
BEBBackendType BackendType = "BEB"
NatsBackendType BackendType = "NATS"
)
// EventingBackendSpec defines the desired state of EventingBackend.
type EventingBackendSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
}
// EventingBackendStatus defines the observed state of EventingBackend.
type EventingBackendStatus struct {
// Specifies the backend type used. The value is either `BEB`, or `NATS`.
// +optional
Backend BackendType `json:"backendType"`
// Defines the overall Backend status.
// +optional
EventingReady *bool `json:"eventingReady"`
// Defines the status of the Controller and the EPP.
// +optional
Conditions []Condition `json:"conditions,omitempty"`
// Name of the Secret containing BEB access tokens, required for BEB only.
// +optional
BEBSecretName string `json:"bebSecretName,omitempty"`
// Namespace of the Secret containing BEB access tokens, required for BEB only.
// +optional
BEBSecretNamespace string `json:"bebSecretNamespace,omitempty"`
}
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Backend",type=string,JSONPath=`.status.backendType`
// +kubebuilder:printcolumn:name="EventingReady",type=boolean,JSONPath=`.status.eventingReady`
// +kubebuilder:printcolumn:name="SubscriptionControllerReady",type=string,JSONPath=`.status.conditions[?(@.type=="Subscription Controller Ready")].status`
// +kubebuilder:printcolumn:name="PublisherProxyReady",type=string,JSONPath=`.status.conditions[?(@.type=="Publisher Proxy Ready")].status`
// EventingBackend is the Schema for the eventingbackends API.
type EventingBackend struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec EventingBackendSpec `json:"spec,omitempty"`
Status EventingBackendStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// EventingBackendList contains a list of EventingBackend.
type EventingBackendList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []EventingBackend `json:"items"`
}
func init() { //nolint:gochecknoinits
SchemeBuilder.Register(&EventingBackend{}, &EventingBackendList{})
}