@@ -53,44 +53,37 @@ const (
5353)
5454
5555// PersistenceProfileSpec defines the desired state of PersistenceProfile
56+ // +kubebuilder:validation:XValidation:rule="((self.persistence_type == 'PERSISTENCE_TYPE_CLIENT_IP_ADDRESS' || self.persistence_type == 'PERSISTENCE_TYPE_CLIENT_IPV6_ADDRESS') && has(self.ip_persistence_profile) && !has(self.hdr_persistence_profile) && !has(self.app_cookie_persistence_profile) && !has(self.http_cookie_persistence_profile)) || (self.persistence_type == 'PERSISTENCE_TYPE_CUSTOM_HTTP_HEADER' && has(self.hdr_persistence_profile) && !has(self.ip_persistence_profile) && !has(self.app_cookie_persistence_profile) && !has(self.http_cookie_persistence_profile)) || (self.persistence_type == 'PERSISTENCE_TYPE_APP_COOKIE' && has(self.app_cookie_persistence_profile) && !has(self.ip_persistence_profile) && !has(self.hdr_persistence_profile) && !has(self.http_cookie_persistence_profile)) || (self.persistence_type == 'PERSISTENCE_TYPE_HTTP_COOKIE' && has(self.http_cookie_persistence_profile) && !has(self.ip_persistence_profile) && !has(self.hdr_persistence_profile) && !has(self.app_cookie_persistence_profile)) || (self.persistence_type == 'PERSISTENCE_TYPE_TLS' && !has(self.ip_persistence_profile) && !has(self.hdr_persistence_profile) && !has(self.app_cookie_persistence_profile) && !has(self.http_cookie_persistence_profile))", message="Invalid profile configuration for persistence_type. When persistence_type is CLIENT_IP_ADDRESS, CLIENT_IPV6_ADDRESS, CUSTOM_HTTP_HEADER, APP_COOKIE, or HTTP_COOKIE, its corresponding profile field (e.g. ipPersistenceProfile) must be set and other profile fields must be absent. For types like TLS, none of these specific profile fields should be set."
5657type PersistenceProfileSpec struct {
57- // Name is a user-friendly name for the persistence profile.
58- // +kubebuilder:validation:Required
59- // +kubebuilder:validation:MaxLength=256
60- Name string `json:"name"`
6158
6259 // ServerHmDownRecovery specifies behavior when a persistent server has been marked down by a health monitor.
6360 // +kubebuilder:default:=HM_DOWN_PICK_NEW_SERVER
64- ServerHmDownRecovery ServerHmDownRecovery `json:"serverHmDownRecovery ,omitempty"`
61+ ServerHmDownRecovery ServerHmDownRecovery `json:"server_hm_down_recovery ,omitempty"`
6562
6663 // PersistenceType is the method used to persist clients to the same server.
6764 // +kubebuilder:default:=PERSISTENCE_TYPE_CLIENT_IP_ADDRESS
6865 // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="type is immutable"
69- PersistenceType PersistenceType `json:"persistenceType ,omitempty"`
66+ PersistenceType PersistenceType `json:"persistence_type ,omitempty"`
7067
7168 // IPPersistenceProfile specifies the Client IP Persistence profile parameters.
7269 // +optional
73- // +kubebuilder:validation:XValidation:rule="self.persistenceType == 'PERSISTENCE_TYPE_CLIENT_IP_ADDRESS'",message="ipPersistenceProfile can only be set when persistenceType is PERSISTENCE_TYPE_CLIENT_IP_ADDRESS"
74- IPPersistenceProfile * IPPersistenceProfile `json:"ipPersistenceProfile,omitempty"`
70+ IPPersistenceProfile * IPPersistenceProfile `json:"ip_persistence_profile,omitempty"`
7571
7672 // HdrPersistenceProfile specifies the custom HTTP Header Persistence profile parameters.
7773 // +optional
78- // +kubebuilder:validation:XValidation:rule="self.persistenceType == 'PERSISTPERSISTENCE_TYPE_CUSTOM_HTTP_HEADER'",message="hdrPersistenceProfile can only be set when persistenceType is PERSISTENCE_TYPE_CUSTOM_HTTP_HEADER"
79- HdrPersistenceProfile * HdrPersistenceProfile `json:"hdrPersistenceProfile,omitempty"`
74+ HdrPersistenceProfile * HdrPersistenceProfile `json:"hdr_persistence_profile,omitempty"`
8075
8176 // AppCookiePersistenceProfile specifies the Application Cookie Persistence profile parameters.
8277 // +optional
83- // +kubebuilder:validation:XValidation:rule="self.persistenceType == 'PERSISTENCE_TYPE_APP_COOKIE'",message="appCookiePersistenceProfile can only be set when persistenceType is PERSISTENCE_TYPE_APP_COOKIE"
84- AppCookiePersistenceProfile * AppCookiePersistenceProfile `json:"appCookiePersistenceProfile,omitempty"`
78+ AppCookiePersistenceProfile * AppCookiePersistenceProfile `json:"app_cookie_persistence_profile,omitempty"`
8579
8680 // HTTPCookiePersistenceProfile specifies the HTTP Cookie Persistence profile parameters.
8781 // +optional
88- // +kubebuilder:validation:XValidation:rule="self.persistenceType == 'PERSISTENCE_TYPE_HTTP_COOKIE'",message="httpCookiePersistenceProfile can only be set when persistenceType is PERSISTENCE_TYPE_HTTP_COOKIE"
89- HTTPCookiePersistenceProfile * HTTPCookiePersistenceProfile `json:"httpCookiePersistenceProfile,omitempty"`
82+ HTTPCookiePersistenceProfile * HTTPCookiePersistenceProfile `json:"http_cookie_persistence_profile,omitempty"`
9083
9184 // IsFederated describes the object's replication scope.
9285 // +kubebuilder:default:=false
93- IsFederated bool `json:"isFederated ,omitempty"`
86+ IsFederated bool `json:"is_federated ,omitempty"`
9487
9588 // Description is a user-friendly description of the persistence profile.
9689 // +optional
@@ -103,26 +96,26 @@ type IPPersistenceProfile struct {
10396 // +kubebuilder:default:=5
10497 // +kubebuilder:validation:Minimum=1
10598 // +kubebuilder:validation:Maximum=720
106- IPPersistentTimeout int32 `json:"ipPersistentTimeout ,omitempty"`
99+ IPPersistentTimeout int32 `json:"ip_persistent_timeout ,omitempty"`
107100
108101 // IPMask is the mask to be applied on client IP.
109102 // +kubebuilder:validation:Minimum=0
110103 // +kubebuilder:validation:Maximum=128
111- IPMask int32 `json:"ipMask ,omitempty"`
104+ IPMask int32 `json:"ip_mask ,omitempty"`
112105}
113106
114107// HdrPersistenceProfile specifies the custom HTTP Header Persistence profile parameters.
115108type HdrPersistenceProfile struct {
116109 // PrstHdrName is the header name for custom header persistence.
117110 // +kubebuilder:validation:MaxLength=128
118- PrstHdrName string `json:"prstHdrName ,omitempty"`
111+ PrstHdrName string `json:"prst_hdr_name ,omitempty"`
119112}
120113
121114// AppCookiePersistenceProfile specifies the Application Cookie Persistence profile parameters.
122115type AppCookiePersistenceProfile struct {
123116 // PrstHdrName is the header or cookie name for application cookie persistence.
124117 // +kubebuilder:validation:MaxLength=128
125- PrstHdrName string `json:"prstHdrName ,omitempty"`
118+ PrstHdrName string `json:"prst_hdr_name ,omitempty"`
126119
127120 // Timeout is the length of time after a client's connections have closed before expiring the client's persistence to a server.
128121 // +kubebuilder:default:=20
@@ -132,14 +125,14 @@ type AppCookiePersistenceProfile struct {
132125
133126 // EncryptionKey is the key to use for cookie encryption.
134127 // +kubebuilder:validation:MaxLength=1024
135- EncryptionKey string `json:"encryptionKey ,omitempty"`
128+ EncryptionKey string `json:"encryption_key ,omitempty"`
136129}
137130
138131// HTTPCookiePersistenceProfile specifies the HTTP Cookie Persistence profile parameters.
139132type HTTPCookiePersistenceProfile struct {
140133 // CookieName is the HTTP cookie name for cookie persistence.
141134 // +kubebuilder:validation:MaxLength=128
142- CookieName string `json:"cookieName ,omitempty"`
135+ CookieName string `json:"cookie_name ,omitempty"`
143136
144137 // Timeout is the maximum lifetime of any session cookie.
145138 // +kubebuilder:validation:Minimum=0
@@ -148,15 +141,15 @@ type HTTPCookiePersistenceProfile struct {
148141
149142 // AlwaysSendCookie indicates if a persistence cookie should always be sent.
150143 // +kubebuilder:default:=false
151- AlwaysSendCookie bool `json:"alwaysSendCookie ,omitempty"`
144+ AlwaysSendCookie bool `json:"always_send_cookie ,omitempty"`
152145
153146 // HTTPOnly sets the HttpOnly attribute in the cookie.
154147 // +kubebuilder:default:=false
155- HTTPOnly bool `json:"httpOnly ,omitempty"`
148+ HTTPOnly bool `json:"http_only ,omitempty"`
156149
157150 // IsPersistentCookie indicates if the cookie is a persistent cookie.
158151 // +kubebuilder:default:=false
159- IsPersistentCookie bool `json:"isPersistentCookie ,omitempty"`
152+ IsPersistentCookie bool `json:"is_persistent_cookie ,omitempty"`
160153}
161154
162155// PersistenceProfileStatus defines the observed state of PersistenceProfile
0 commit comments