-
Notifications
You must be signed in to change notification settings - Fork 110
/
Copy pathnginxgateway_types.go
93 lines (74 loc) · 3.14 KB
/
nginxgateway_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
package v1alpha1
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// +genclient
// +kubebuilder:object:root=true
// +kubebuilder:storageversion
// +kubebuilder:subresource:status
// +kubebuilder:resource:categories=nginx-gateway-fabric
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
// NginxGateway represents the dynamic configuration for an NGINX Gateway Fabric control plane.
type NginxGateway struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
// NginxGatewaySpec defines the desired state of the NginxGateway.
Spec NginxGatewaySpec `json:"spec"`
// NginxGatewayStatus defines the state of the NginxGateway.
Status NginxGatewayStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// NginxGatewayList contains a list of NginxGateways.
type NginxGatewayList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []NginxGateway `json:"items"`
}
// NginxGatewaySpec defines the desired state of the NginxGateway.
type NginxGatewaySpec struct {
// Logging defines logging related settings for the control plane.
//
// +optional
Logging *Logging `json:"logging,omitempty"`
}
// Logging defines logging related settings for the control plane.
type Logging struct {
// Level defines the logging level.
//
// +optional
// +kubebuilder:default=info
Level *ControllerLogLevel `json:"level,omitempty"`
}
// ControllerLogLevel type defines the logging level for the control plane.
//
// +kubebuilder:validation:Enum=info;debug;error
type ControllerLogLevel string
const (
// ControllerLogLevelInfo is the info level for control plane logging.
ControllerLogLevelInfo ControllerLogLevel = "info"
// ControllerLogLevelDebug is the debug level for control plane logging.
ControllerLogLevelDebug ControllerLogLevel = "debug"
// ControllerLogLevelError is the error level for control plane logging.
ControllerLogLevelError ControllerLogLevel = "error"
)
// NginxGatewayStatus defines the state of the NginxGateway.
type NginxGatewayStatus struct {
// +optional
// +listType=map
// +listMapKey=type
// +kubebuilder:validation:MaxItems=8
Conditions []metav1.Condition `json:"conditions,omitempty"`
}
// NginxGatewayConditionType is a type of condition associated with an
// NginxGateway. This type should be used with the NginxGatewayStatus.Conditions field.
type NginxGatewayConditionType string
// NginxGatewayConditionReason defines the set of reasons that explain why a
// particular NginxGateway condition type has been raised.
type NginxGatewayConditionReason string
const (
// NginxGatewayConditionValid is a condition that is true when the NginxGateway
// configuration is syntactically and semantically valid.
NginxGatewayConditionValid NginxGatewayConditionType = "Valid"
// NginxGatewayReasonValid is a reason that is used with the "Valid" condition when the condition is True.
NginxGatewayReasonValid NginxGatewayConditionReason = "Valid"
// NginxGatewayReasonInvalid is a reason that is used with the "Valid" condition when the condition is False.
NginxGatewayReasonInvalid NginxGatewayConditionReason = "Invalid"
)