@@ -244,12 +244,12 @@ func (r *OpenStackControlPlane) ValidateCreateServices(basePath *field.Path) (ad
244244
245245 // Call internal validation logic for individual service operators
246246 if r .Spec .Keystone .Enabled {
247- errors = append (errors , r .Spec .Keystone .Template .ValidateCreate (basePath .Child ("keystone" ).Child ("template" ))... )
247+ errors = append (errors , r .Spec .Keystone .Template .ValidateCreate (basePath .Child ("keystone" ).Child ("template" ), r . Namespace )... )
248248 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Keystone .APIOverride .Route , basePath .Child ("keystone" ).Child ("apiOverride" ).Child ("route" ))... )
249249 }
250250
251251 if r .Spec .Ironic .Enabled {
252- errors = append (errors , r .Spec .Ironic .Template .ValidateCreate (basePath .Child ("ironic" ).Child ("template" ))... )
252+ errors = append (errors , r .Spec .Ironic .Template .ValidateCreate (basePath .Child ("ironic" ).Child ("template" ), r . Namespace )... )
253253 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Ironic .APIOverride .Route , basePath .Child ("ironic" ).Child ("apiOverride" ).Child ("route" ))... )
254254 }
255255
@@ -259,17 +259,17 @@ func (r *OpenStackControlPlane) ValidateCreateServices(basePath *field.Path) (ad
259259 }
260260
261261 if r .Spec .Placement .Enabled {
262- errors = append (errors , r .Spec .Placement .Template .ValidateCreate (basePath .Child ("placement" ).Child ("template" ))... )
262+ errors = append (errors , r .Spec .Placement .Template .ValidateCreate (basePath .Child ("placement" ).Child ("template" ), r . Namespace )... )
263263 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Placement .APIOverride .Route , basePath .Child ("placement" ).Child ("apiOverride" ).Child ("route" ))... )
264264 }
265265
266266 if r .Spec .Barbican .Enabled {
267- errors = append (errors , r .Spec .Barbican .Template .ValidateCreate (basePath .Child ("barbican" ).Child ("template" ))... )
267+ errors = append (errors , r .Spec .Barbican .Template .ValidateCreate (basePath .Child ("barbican" ).Child ("template" ), r . Namespace )... )
268268 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Barbican .APIOverride .Route , basePath .Child ("barbican" ).Child ("apiOverride" ).Child ("route" ))... )
269269 }
270270
271271 if r .Spec .Neutron .Enabled {
272- errors = append (errors , r .Spec .Neutron .Template .ValidateCreate (basePath .Child ("neutron" ).Child ("template" ))... )
272+ errors = append (errors , r .Spec .Neutron .Template .ValidateCreate (basePath .Child ("neutron" ).Child ("template" ), r . Namespace )... )
273273 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Neutron .APIOverride .Route , basePath .Child ("neutron" ).Child ("apiOverride" ).Child ("route" ))... )
274274 }
275275
@@ -282,7 +282,7 @@ func (r *OpenStackControlPlane) ValidateCreateServices(basePath *field.Path) (ad
282282 glancev1 .GetCrMaxLengthCorrection (glanceName , glanceAPI .Type )) // omit issue with statefulset pod label "controller-revision-hash": "<statefulset_name>-<hash>"
283283 errors = append (errors , err ... )
284284 }
285- errors = append (errors , r .Spec .Glance .Template .ValidateCreate (basePath .Child ("glance" ).Child ("template" ))... )
285+ errors = append (errors , r .Spec .Glance .Template .ValidateCreate (basePath .Child ("glance" ).Child ("template" ), r . Namespace )... )
286286
287287 for key , override := range r .Spec .Glance .APIOverride {
288288 overridePath := basePath .Child ("glance" ).Child ("apiOverride" ).Key (key )
@@ -297,39 +297,39 @@ func (r *OpenStackControlPlane) ValidateCreateServices(basePath *field.Path) (ad
297297 maps .Keys (r .Spec .Cinder .Template .CinderVolumes ),
298298 cinderv1 .GetCrMaxLengthCorrection (cinderName )) // omit issue with statefulset pod label "controller-revision-hash": "<statefulset_name>-<hash>"
299299 errors = append (errors , errs ... )
300- errors = append (errors , r .Spec .Cinder .Template .ValidateCreate (basePath .Child ("cinder" ).Child ("template" ))... )
300+ errors = append (errors , r .Spec .Cinder .Template .ValidateCreate (basePath .Child ("cinder" ).Child ("template" ), r . Namespace )... )
301301 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Cinder .APIOverride .Route , basePath .Child ("cinder" ).Child ("apiOverride" ).Child ("route" ))... )
302302 }
303303
304304 if r .Spec .Heat .Enabled {
305- errors = append (errors , r .Spec .Heat .Template .ValidateCreate (basePath .Child ("heat" ).Child ("template" ))... )
305+ errors = append (errors , r .Spec .Heat .Template .ValidateCreate (basePath .Child ("heat" ).Child ("template" ), r . Namespace )... )
306306 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Heat .APIOverride .Route , basePath .Child ("heat" ).Child ("apiOverride" ).Child ("route" ))... )
307307 }
308308
309309 if r .Spec .Manila .Enabled {
310- errors = append (errors , r .Spec .Manila .Template .ValidateCreate (basePath .Child ("manila" ).Child ("template" ))... )
310+ errors = append (errors , r .Spec .Manila .Template .ValidateCreate (basePath .Child ("manila" ).Child ("template" ), r . Namespace )... )
311311 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Manila .APIOverride .Route , basePath .Child ("manila" ).Child ("apiOverride" ).Child ("route" ))... )
312312 }
313313
314314 if r .Spec .Swift .Enabled {
315- errors = append (errors , r .Spec .Swift .Template .ValidateCreate (basePath .Child ("swift" ).Child ("template" ))... )
315+ errors = append (errors , r .Spec .Swift .Template .ValidateCreate (basePath .Child ("swift" ).Child ("template" ), r . Namespace )... )
316316 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Swift .ProxyOverride .Route , basePath .Child ("swift" ).Child ("apiOverride" ).Child ("route" ))... )
317317 }
318318
319319 if r .Spec .Octavia .Enabled {
320- errors = append (errors , r .Spec .Octavia .Template .ValidateCreate (basePath .Child ("octavia" ).Child ("template" ))... )
320+ errors = append (errors , r .Spec .Octavia .Template .ValidateCreate (basePath .Child ("octavia" ).Child ("template" ), r . Namespace )... )
321321 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Octavia .APIOverride .Route , basePath .Child ("octavia" ).Child ("apiOverride" ).Child ("route" ))... )
322322 }
323323
324324 if r .Spec .Designate .Enabled {
325- errors = append (errors , r .Spec .Designate .Template .ValidateCreate (basePath .Child ("designate" ).Child ("template" ))... )
325+ errors = append (errors , r .Spec .Designate .Template .ValidateCreate (basePath .Child ("designate" ).Child ("template" ), r . Namespace )... )
326326 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Designate .APIOverride .Route , basePath .Child ("designate" ).Child ("apiOverride" ).Child ("route" ))... )
327327 }
328328
329329 // Validation for remaining services...
330330 if r .Spec .Galera .Enabled {
331331 for key , s := range * r .Spec .Galera .Templates {
332- warn , err := s .ValidateCreate (basePath .Child ("galera" ).Child ("template" ).Key (key ))
332+ warn , err := s .ValidateCreate (basePath .Child ("galera" ).Child ("template" ).Key (key ), r . Namespace )
333333 errors = append (errors , err ... )
334334 warnings = append (warnings , warn ... )
335335 }
@@ -389,15 +389,15 @@ func (r *OpenStackControlPlane) ValidateUpdateServices(old OpenStackControlPlane
389389 if old .Keystone .Template == nil {
390390 old .Keystone .Template = & keystonev1.KeystoneAPISpecCore {}
391391 }
392- errors = append (errors , r .Spec .Keystone .Template .ValidateUpdate (* old .Keystone .Template , basePath .Child ("keystone" ).Child ("template" ))... )
392+ errors = append (errors , r .Spec .Keystone .Template .ValidateUpdate (* old .Keystone .Template , basePath .Child ("keystone" ).Child ("template" ), r . Namespace )... )
393393 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Keystone .APIOverride .Route , basePath .Child ("keystone" ).Child ("apiOverride" ).Child ("route" ))... )
394394 }
395395
396396 if r .Spec .Ironic .Enabled {
397397 if old .Ironic .Template == nil {
398398 old .Ironic .Template = & ironicv1.IronicSpecCore {}
399399 }
400- errors = append (errors , r .Spec .Ironic .Template .ValidateUpdate (* old .Ironic .Template , basePath .Child ("ironic" ).Child ("template" ))... )
400+ errors = append (errors , r .Spec .Ironic .Template .ValidateUpdate (* old .Ironic .Template , basePath .Child ("ironic" ).Child ("template" ), r . Namespace )... )
401401 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Ironic .APIOverride .Route , basePath .Child ("ironic" ).Child ("apiOverride" ).Child ("route" ))... )
402402 }
403403
@@ -413,23 +413,23 @@ func (r *OpenStackControlPlane) ValidateUpdateServices(old OpenStackControlPlane
413413 if old .Placement .Template == nil {
414414 old .Placement .Template = & placementv1.PlacementAPISpecCore {}
415415 }
416- errors = append (errors , r .Spec .Placement .Template .ValidateUpdate (* old .Placement .Template , basePath .Child ("placement" ).Child ("template" ))... )
416+ errors = append (errors , r .Spec .Placement .Template .ValidateUpdate (* old .Placement .Template , basePath .Child ("placement" ).Child ("template" ), r . Namespace )... )
417417 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Placement .APIOverride .Route , basePath .Child ("placement" ).Child ("apiOverride" ).Child ("route" ))... )
418418 }
419419
420420 if r .Spec .Barbican .Enabled {
421421 if old .Barbican .Template == nil {
422422 old .Barbican .Template = & barbicanv1.BarbicanSpecCore {}
423423 }
424- errors = append (errors , r .Spec .Barbican .Template .ValidateUpdate (* old .Barbican .Template , basePath .Child ("barbican" ).Child ("template" ))... )
424+ errors = append (errors , r .Spec .Barbican .Template .ValidateUpdate (* old .Barbican .Template , basePath .Child ("barbican" ).Child ("template" ), r . Namespace )... )
425425 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Barbican .APIOverride .Route , basePath .Child ("barbican" ).Child ("apiOverride" ).Child ("route" ))... )
426426 }
427427
428428 if r .Spec .Neutron .Enabled {
429429 if old .Neutron .Template == nil {
430430 old .Neutron .Template = & neutronv1.NeutronAPISpecCore {}
431431 }
432- errors = append (errors , r .Spec .Neutron .Template .ValidateUpdate (* old .Neutron .Template , basePath .Child ("neutron" ).Child ("template" ))... )
432+ errors = append (errors , r .Spec .Neutron .Template .ValidateUpdate (* old .Neutron .Template , basePath .Child ("neutron" ).Child ("template" ), r . Namespace )... )
433433 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Neutron .APIOverride .Route , basePath .Child ("neutron" ).Child ("apiOverride" ).Child ("route" ))... )
434434 }
435435
@@ -445,7 +445,7 @@ func (r *OpenStackControlPlane) ValidateUpdateServices(old OpenStackControlPlane
445445 glancev1 .GetCrMaxLengthCorrection (glanceName , glanceAPI .Type )) // omit issue with statefulset pod label "controller-revision-hash": "<statefulset_name>-<hash>"
446446 errors = append (errors , err ... )
447447 }
448- errors = append (errors , r .Spec .Glance .Template .ValidateUpdate (* old .Glance .Template , basePath .Child ("glance" ).Child ("template" ))... )
448+ errors = append (errors , r .Spec .Glance .Template .ValidateUpdate (* old .Glance .Template , basePath .Child ("glance" ).Child ("template" ), r . Namespace )... )
449449
450450 for key , override := range r .Spec .Glance .APIOverride {
451451 overridePath := basePath .Child ("glance" ).Child ("apiOverride" ).Key (key )
@@ -463,47 +463,47 @@ func (r *OpenStackControlPlane) ValidateUpdateServices(old OpenStackControlPlane
463463 maps .Keys (r .Spec .Cinder .Template .CinderVolumes ),
464464 cinderv1 .GetCrMaxLengthCorrection (cinderName )) // omit issue with statefulset pod label "controller-revision-hash": "<statefulset_name>-<hash>"
465465 errors = append (errors , errs ... )
466- errors = append (errors , r .Spec .Cinder .Template .ValidateUpdate (* old .Cinder .Template , basePath .Child ("cinder" ).Child ("template" ))... )
466+ errors = append (errors , r .Spec .Cinder .Template .ValidateUpdate (* old .Cinder .Template , basePath .Child ("cinder" ).Child ("template" ), r . Namespace )... )
467467 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Cinder .APIOverride .Route , basePath .Child ("cinder" ).Child ("apiOverride" ).Child ("route" ))... )
468468 }
469469
470470 if r .Spec .Heat .Enabled {
471471 if old .Heat .Template == nil {
472472 old .Heat .Template = & heatv1.HeatSpecCore {}
473473 }
474- errors = append (errors , r .Spec .Heat .Template .ValidateUpdate (* old .Heat .Template , basePath .Child ("heat" ).Child ("template" ))... )
474+ errors = append (errors , r .Spec .Heat .Template .ValidateUpdate (* old .Heat .Template , basePath .Child ("heat" ).Child ("template" ), r . Namespace )... )
475475 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Heat .APIOverride .Route , basePath .Child ("heat" ).Child ("apiOverride" ).Child ("route" ))... )
476476 }
477477
478478 if r .Spec .Manila .Enabled {
479479 if old .Manila .Template == nil {
480480 old .Manila .Template = & manilav1.ManilaSpecCore {}
481481 }
482- errors = append (errors , r .Spec .Manila .Template .ValidateUpdate (* old .Manila .Template , basePath .Child ("manila" ).Child ("template" ))... )
482+ errors = append (errors , r .Spec .Manila .Template .ValidateUpdate (* old .Manila .Template , basePath .Child ("manila" ).Child ("template" ), r . Namespace )... )
483483 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Manila .APIOverride .Route , basePath .Child ("manila" ).Child ("apiOverride" ).Child ("route" ))... )
484484 }
485485
486486 if r .Spec .Swift .Enabled {
487487 if old .Swift .Template == nil {
488488 old .Swift .Template = & swiftv1.SwiftSpecCore {}
489489 }
490- errors = append (errors , r .Spec .Swift .Template .ValidateUpdate (* old .Swift .Template , basePath .Child ("swift" ).Child ("template" ))... )
490+ errors = append (errors , r .Spec .Swift .Template .ValidateUpdate (* old .Swift .Template , basePath .Child ("swift" ).Child ("template" ), r . Namespace )... )
491491 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Swift .ProxyOverride .Route , basePath .Child ("swift" ).Child ("apiOverride" ).Child ("route" ))... )
492492 }
493493
494494 if r .Spec .Octavia .Enabled {
495495 if old .Octavia .Template == nil {
496496 old .Octavia .Template = & octaviav1.OctaviaSpecCore {}
497497 }
498- errors = append (errors , r .Spec .Octavia .Template .ValidateUpdate (* old .Octavia .Template , basePath .Child ("octavia" ).Child ("template" ))... )
498+ errors = append (errors , r .Spec .Octavia .Template .ValidateUpdate (* old .Octavia .Template , basePath .Child ("octavia" ).Child ("template" ), r . Namespace )... )
499499 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Octavia .APIOverride .Route , basePath .Child ("octavia" ).Child ("apiOverride" ).Child ("route" ))... )
500500 }
501501
502502 if r .Spec .Designate .Enabled {
503503 if old .Designate .Template == nil {
504504 old .Designate .Template = & designatev1.DesignateSpecCore {}
505505 }
506- errors = append (errors , r .Spec .Designate .Template .ValidateUpdate (* old .Designate .Template , basePath .Child ("designate" ).Child ("template" ))... )
506+ errors = append (errors , r .Spec .Designate .Template .ValidateUpdate (* old .Designate .Template , basePath .Child ("designate" ).Child ("template" ), r . Namespace )... )
507507 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Designate .APIOverride .Route , basePath .Child ("designate" ).Child ("apiOverride" ).Child ("route" ))... )
508508 }
509509
0 commit comments