@@ -80,7 +80,7 @@ type OpenStackControlPlaneSpec struct {
8080
8181 // +kubebuilder:validation:Optional
8282 // +operator-sdk:csv:customresourcedefinitions:type=spec
83- // +kubebuilder:default={ingress: {enabled: true, ca: {duration: "87600h"}, cert: {duration: "10950h "}}, podLevel: {enabled: true, internal:{ca: {duration: "87600h"}, cert: {duration: "10950h "}}, libvirt: {ca: {duration: "87600h"}, cert: {duration: "43800h"}}, ovn: {ca: {duration: "87600h"}, cert: {duration: "10950h "}}}}
83+ // +kubebuilder:default={ingress: {enabled: true, ca: {duration: "87600h"}, cert: {duration: "43800h "}}, podLevel: {enabled: true, internal:{ca: {duration: "87600h"}, cert: {duration: "43800h "}}, libvirt: {ca: {duration: "87600h"}, cert: {duration: "43800h"}}, ovn: {ca: {duration: "87600h"}, cert: {duration: "43800h "}}}}
8484 // TLS - Parameters related to the TLS
8585 TLS TLSSection `json:"tls"`
8686
@@ -190,10 +190,12 @@ type OpenStackControlPlaneSpec struct {
190190type TLSSection struct {
191191 // +kubebuilder:validation:optional
192192 //+operator-sdk:csv:customresourcedefinitions:type=spec
193+ // +kubebuilder:default={enabled: true, ca: {duration: "87600h"}, cert: {duration: "43800h"}}
193194 Ingress TLSIngressConfig `json:"ingress,omitempty"`
194195
195196 // +kubebuilder:validation:optional
196197 //+operator-sdk:csv:customresourcedefinitions:type=spec
198+ // +kubebuilder:default={enabled: true, internal:{ca: {duration: "87600h"}, cert: {duration: "43800h"}}, libvirt: {ca: {duration: "87600h"}, cert: {duration: "43800h"}}, ovn: {ca: {duration: "87600h"}, cert: {duration: "43800h"}}}
197199 PodLevel TLSPodLevelConfig `json:"podLevel,omitempty"`
198200
199201 // +kubebuilder:validation:optional
@@ -209,6 +211,7 @@ type TLSIngressConfig struct {
209211 // +kubebuilder:validation:Optional
210212 // +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
211213 // Enabled - Whether TLS should be enabled for endpoint type
214+ // +kubebuilder:default=true
212215 Enabled bool `json:"enabled"`
213216
214217 // +kubebuilder:validation:optional
@@ -221,43 +224,62 @@ type TLSPodLevelConfig struct {
221224 // +kubebuilder:validation:Optional
222225 // +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
223226 // Enabled - Whether TLS should be enabled for endpoint type
227+ // +kubebuilder:default=true
224228 Enabled bool `json:"enabled"`
225229
226230 // +kubebuilder:validation:Optional
227231 // +operator-sdk:csv:customresourcedefinitions:type=spec
232+ // +kubebuilder:default={ca: {duration: "87600h"}, cert: {duration: "43800h"}}
228233 // Internal - default CA used for all OpenStackControlPlane and OpenStackDataplane endpoints,
229234 // except OVN related CA and certs
230- Internal CertSection `json:"internal,omitempty "`
235+ Internal CertSection `json:"internal"`
231236
232237 // +kubebuilder:validation:Optional
233238 // +operator-sdk:csv:customresourcedefinitions:type=spec
239+ // +kubebuilder:default={ca: {duration: "87600h"}, cert: {duration: "43800h"}}
234240 // Libvirt - CA used for libvirt/qemu services on OpenStackControlPlane and OpenStackDataplane
235- Libvirt CertSection `json:"libvirt,omitempty "`
241+ Libvirt CertSection `json:"libvirt"`
236242
237243 // +kubebuilder:validation:Optional
238244 // +operator-sdk:csv:customresourcedefinitions:type=spec
245+ // +kubebuilder:default={ca: {duration: "87600h"}, cert: {duration: "43800h"}}
239246 // Ovn - CA used for all OVN services on OpenStackControlPlane and OpenStackDataplane
240- Ovn CertSection `json:"ovn,omitempty "`
247+ Ovn CertSection `json:"ovn"`
241248}
242249
243250// CertSection defines details for CA config and its certs
244251type CertSection struct {
245252 // +kubebuilder:validation:Optional
246253 // +operator-sdk:csv:customresourcedefinitions:type=spec
254+ // +kubebuilder:default={duration: "43800h"}
247255 // Cert - defines details for cert config
248- Cert CertConfig `json:"cert,omitempty "`
256+ Cert CertConfig `json:"cert"`
249257
250258 // +kubebuilder:validation:Optional
251259 // +operator-sdk:csv:customresourcedefinitions:type=spec
260+ // +kubebuilder:default={duration: "87600h"}
252261 // Ca - defines details for CA cert config
253- Ca CACertConfig `json:"ca,omitempty "`
262+ Ca CACertConfig `json:"ca"`
254263}
255264
256265// CACertConfig defines details for ca cert configs
257266type CACertConfig struct {
258- // +kubebuilder:validation:optional
259- //+operator-sdk:csv:customresourcedefinitions:type=spec
260- CertConfig `json:",inline"`
267+ // +kubebuilder:validation:Optional
268+ // +kubebuilder:default="87600h"
269+ // The requested 'duration' (i.e. lifetime) of the Certificate.
270+ // The Certificate will be renewed either 2/3 through its duration or
271+ // `renewBefore` period before its expiry, whichever is later. Minimum
272+ // accepted duration is 1 hour. Value must be in units accepted by Go
273+ // time.ParseDuration https://golang.org/pkg/time/#ParseDuration
274+ Duration * metav1.Duration `json:"duration"`
275+
276+ // +kubebuilder:validation:Optional
277+ // How long before the currently issued certificate's expiry
278+ // cert-manager should renew the certificate. The default is 2/3 of the
279+ // issued certificate's duration. Minimum accepted value is 5 minutes.
280+ // Value must be in units accepted by Go time.ParseDuration
281+ // https://golang.org/pkg/time/#ParseDuration
282+ RenewBefore * metav1.Duration `json:"renewBefore,omitempty"`
261283
262284 // +kubebuilder:validation:Optional
263285 // CustomIssuer - use pre-created issue for this CA. No CA and issure is being created
@@ -267,20 +289,21 @@ type CACertConfig struct {
267289
268290// CertConfig defines details for cert configs
269291type CertConfig struct {
292+ // +kubebuilder:validation:Optional
293+ // +kubebuilder:default="43800h"
270294 // The requested 'duration' (i.e. lifetime) of the Certificate.
271295 // The Certificate will be renewed either 2/3 through its duration or
272296 // `renewBefore` period before its expiry, whichever is later. Minimum
273297 // accepted duration is 1 hour. Value must be in units accepted by Go
274298 // time.ParseDuration https://golang.org/pkg/time/#ParseDuration
275- // +optional
276- Duration * metav1.Duration `json:"duration,omitempty"`
299+ Duration * metav1.Duration `json:"duration"`
277300
301+ // +kubebuilder:validation:Optional
278302 // How long before the currently issued certificate's expiry
279303 // cert-manager should renew the certificate. The default is 2/3 of the
280304 // issued certificate's duration. Minimum accepted value is 5 minutes.
281305 // Value must be in units accepted by Go time.ParseDuration
282306 // https://golang.org/pkg/time/#ParseDuration
283- // +optional
284307 RenewBefore * metav1.Duration `json:"renewBefore,omitempty"`
285308}
286309
0 commit comments