@@ -263,17 +263,23 @@ func (r *OpenStackControlPlane) ValidateCreateServices(basePath *field.Path) (ad
263263
264264 // Call internal validation logic for individual service operators
265265 if r .Spec .Keystone .Enabled {
266- errors = append (errors , r .Spec .Keystone .Template .ValidateCreate (basePath .Child ("keystone" ).Child ("template" ), r .Namespace )... )
266+ warns , errs := r .Spec .Keystone .Template .ValidateCreate (basePath .Child ("keystone" ).Child ("template" ), r .Namespace )
267+ errors = append (errors , errs ... )
268+ warnings = append (warnings , warns ... )
267269 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Keystone .APIOverride .Route , basePath .Child ("keystone" ).Child ("apiOverride" ).Child ("route" ))... )
268270 }
269271
270272 if r .Spec .Ironic .Enabled {
271- errors = append (errors , r .Spec .Ironic .Template .ValidateCreate (basePath .Child ("ironic" ).Child ("template" ), r .Namespace )... )
273+ warns , errs := r .Spec .Ironic .Template .ValidateCreate (basePath .Child ("ironic" ).Child ("template" ), r .Namespace )
274+ errors = append (errors , errs ... )
275+ warnings = append (warnings , warns ... )
272276 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Ironic .APIOverride .Route , basePath .Child ("ironic" ).Child ("apiOverride" ).Child ("route" ))... )
273277 }
274278
275279 if r .Spec .Nova .Enabled {
276- errors = append (errors , r .Spec .Nova .Template .ValidateCreate (basePath .Child ("nova" ).Child ("template" ), r .Namespace )... )
280+ warns , errs := r .Spec .Nova .Template .ValidateCreate (basePath .Child ("nova" ).Child ("template" ), r .Namespace )
281+ errors = append (errors , errs ... )
282+ warnings = append (warnings , warns ... )
277283 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Nova .APIOverride .Route , basePath .Child ("nova" ).Child ("apiOverride" ).Child ("route" ))... )
278284 }
279285
@@ -283,12 +289,16 @@ func (r *OpenStackControlPlane) ValidateCreateServices(basePath *field.Path) (ad
283289 }
284290
285291 if r .Spec .Barbican .Enabled {
286- errors = append (errors , r .Spec .Barbican .Template .ValidateCreate (basePath .Child ("barbican" ).Child ("template" ), r .Namespace )... )
292+ warns , errs := r .Spec .Barbican .Template .ValidateCreate (basePath .Child ("barbican" ).Child ("template" ), r .Namespace )
293+ errors = append (errors , errs ... )
294+ warnings = append (warnings , warns ... )
287295 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Barbican .APIOverride .Route , basePath .Child ("barbican" ).Child ("apiOverride" ).Child ("route" ))... )
288296 }
289297
290298 if r .Spec .Neutron .Enabled {
291- errors = append (errors , r .Spec .Neutron .Template .ValidateCreate (basePath .Child ("neutron" ).Child ("template" ), r .Namespace )... )
299+ warns , errs := r .Spec .Neutron .Template .ValidateCreate (basePath .Child ("neutron" ).Child ("template" ), r .Namespace )
300+ errors = append (errors , errs ... )
301+ warnings = append (warnings , warns ... )
292302 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Neutron .APIOverride .Route , basePath .Child ("neutron" ).Child ("apiOverride" ).Child ("route" ))... )
293303 }
294304
@@ -301,7 +311,9 @@ func (r *OpenStackControlPlane) ValidateCreateServices(basePath *field.Path) (ad
301311 glancev1 .GetCrMaxLengthCorrection (glanceName , glanceAPI .Type )) // omit issue with statefulset pod label "controller-revision-hash": "<statefulset_name>-<hash>"
302312 errors = append (errors , err ... )
303313 }
304- errors = append (errors , r .Spec .Glance .Template .ValidateCreate (basePath .Child ("glance" ).Child ("template" ), r .Namespace )... )
314+ warns , errs := r .Spec .Glance .Template .ValidateCreate (basePath .Child ("glance" ).Child ("template" ), r .Namespace )
315+ errors = append (errors , errs ... )
316+ warnings = append (warnings , warns ... )
305317
306318 for key , override := range r .Spec .Glance .APIOverride {
307319 overridePath := basePath .Child ("glance" ).Child ("apiOverride" ).Key (key )
@@ -323,12 +335,16 @@ func (r *OpenStackControlPlane) ValidateCreateServices(basePath *field.Path) (ad
323335 }
324336
325337 if r .Spec .Heat .Enabled {
326- errors = append (errors , r .Spec .Heat .Template .ValidateCreate (basePath .Child ("heat" ).Child ("template" ), r .Namespace )... )
338+ warns , errs := r .Spec .Heat .Template .ValidateCreate (basePath .Child ("heat" ).Child ("template" ), r .Namespace )
339+ errors = append (errors , errs ... )
340+ warnings = append (warnings , warns ... )
327341 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Heat .APIOverride .Route , basePath .Child ("heat" ).Child ("apiOverride" ).Child ("route" ))... )
328342 }
329343
330344 if r .Spec .Manila .Enabled {
331- errors = append (errors , r .Spec .Manila .Template .ValidateCreate (basePath .Child ("manila" ).Child ("template" ), r .Namespace )... )
345+ warns , errs := r .Spec .Manila .Template .ValidateCreate (basePath .Child ("manila" ).Child ("template" ), r .Namespace )
346+ errors = append (errors , errs ... )
347+ warnings = append (warnings , warns ... )
332348 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Manila .APIOverride .Route , basePath .Child ("manila" ).Child ("apiOverride" ).Child ("route" ))... )
333349 }
334350
@@ -338,22 +354,30 @@ func (r *OpenStackControlPlane) ValidateCreateServices(basePath *field.Path) (ad
338354 }
339355
340356 if r .Spec .Octavia .Enabled {
341- errors = append (errors , r .Spec .Octavia .Template .ValidateCreate (basePath .Child ("octavia" ).Child ("template" ), r .Namespace )... )
357+ warns , errs := r .Spec .Octavia .Template .ValidateCreate (basePath .Child ("octavia" ).Child ("template" ), r .Namespace )
358+ errors = append (errors , errs ... )
359+ warnings = append (warnings , warns ... )
342360 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Octavia .APIOverride .Route , basePath .Child ("octavia" ).Child ("apiOverride" ).Child ("route" ))... )
343361 }
344362
345363 if r .Spec .Designate .Enabled {
346- errors = append (errors , r .Spec .Designate .Template .ValidateCreate (basePath .Child ("designate" ).Child ("template" ), r .Namespace )... )
364+ warns , errs := r .Spec .Designate .Template .ValidateCreate (basePath .Child ("designate" ).Child ("template" ), r .Namespace )
365+ errors = append (errors , errs ... )
366+ warnings = append (warnings , warns ... )
347367 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Designate .APIOverride .Route , basePath .Child ("designate" ).Child ("apiOverride" ).Child ("route" ))... )
348368 }
349369
350370 if r .Spec .Watcher .Enabled {
351- errors = append (errors , r .Spec .Watcher .Template .ValidateCreate (basePath .Child ("watcher" ).Child ("template" ), r .Namespace )... )
371+ warns , errs := r .Spec .Watcher .Template .ValidateCreate (basePath .Child ("watcher" ).Child ("template" ), r .Namespace )
372+ errors = append (errors , errs ... )
373+ warnings = append (warnings , warns ... )
352374 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Watcher .APIOverride .Route , basePath .Child ("watcher" ).Child ("apiOverride" ).Child ("route" ))... )
353375 }
354376
355377 if r .Spec .Telemetry .Enabled {
356- errors = append (errors , r .Spec .Telemetry .Template .ValidateCreate (basePath .Child ("telemetry" ).Child ("template" ), r .Namespace )... )
378+ warns , errs := r .Spec .Telemetry .Template .ValidateCreate (basePath .Child ("telemetry" ).Child ("template" ), r .Namespace )
379+ errors = append (errors , errs ... )
380+ warnings = append (warnings , warns ... )
357381 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Telemetry .AodhAPIOverride .Route , basePath .Child ("telemetry" ).Child ("aodhApiOverride" ).Child ("route" ))... )
358382 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Telemetry .PrometheusOverride .Route , basePath .Child ("telemetry" ).Child ("prometheusOverride" ).Child ("route" ))... )
359383 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Telemetry .AlertmanagerOverride .Route , basePath .Child ("telemetry" ).Child ("alertmanagerOverride" ).Child ("route" ))... )
@@ -429,23 +453,29 @@ func (r *OpenStackControlPlane) ValidateUpdateServices(old OpenStackControlPlane
429453 if old .Keystone .Template == nil {
430454 old .Keystone .Template = & keystonev1.KeystoneAPISpecCore {}
431455 }
432- errors = append (errors , r .Spec .Keystone .Template .ValidateUpdate (* old .Keystone .Template , basePath .Child ("keystone" ).Child ("template" ), r .Namespace )... )
456+ warns , errs := r .Spec .Keystone .Template .ValidateUpdate (* old .Keystone .Template , basePath .Child ("keystone" ).Child ("template" ), r .Namespace )
457+ errors = append (errors , errs ... )
458+ warnings = append (warnings , warns ... )
433459 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Keystone .APIOverride .Route , basePath .Child ("keystone" ).Child ("apiOverride" ).Child ("route" ))... )
434460 }
435461
436462 if r .Spec .Ironic .Enabled {
437463 if old .Ironic .Template == nil {
438464 old .Ironic .Template = & ironicv1.IronicSpecCore {}
439465 }
440- errors = append (errors , r .Spec .Ironic .Template .ValidateUpdate (* old .Ironic .Template , basePath .Child ("ironic" ).Child ("template" ), r .Namespace )... )
466+ warns , errs := r .Spec .Ironic .Template .ValidateUpdate (* old .Ironic .Template , basePath .Child ("ironic" ).Child ("template" ), r .Namespace )
467+ errors = append (errors , errs ... )
468+ warnings = append (warnings , warns ... )
441469 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Ironic .APIOverride .Route , basePath .Child ("ironic" ).Child ("apiOverride" ).Child ("route" ))... )
442470 }
443471
444472 if r .Spec .Nova .Enabled {
445473 if old .Nova .Template == nil {
446474 old .Nova .Template = & novav1.NovaSpecCore {}
447475 }
448- errors = append (errors , r .Spec .Nova .Template .ValidateUpdate (* old .Nova .Template , basePath .Child ("nova" ).Child ("template" ), r .Namespace )... )
476+ warns , errs := r .Spec .Nova .Template .ValidateUpdate (* old .Nova .Template , basePath .Child ("nova" ).Child ("template" ), r .Namespace )
477+ errors = append (errors , errs ... )
478+ warnings = append (warnings , warns ... )
449479 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Nova .APIOverride .Route , basePath .Child ("nova" ).Child ("apiOverride" ).Child ("route" ))... )
450480 }
451481
@@ -461,15 +491,19 @@ func (r *OpenStackControlPlane) ValidateUpdateServices(old OpenStackControlPlane
461491 if old .Barbican .Template == nil {
462492 old .Barbican .Template = & barbicanv1.BarbicanSpecCore {}
463493 }
464- errors = append (errors , r .Spec .Barbican .Template .ValidateUpdate (* old .Barbican .Template , basePath .Child ("barbican" ).Child ("template" ), r .Namespace )... )
494+ warns , errs := r .Spec .Barbican .Template .ValidateUpdate (* old .Barbican .Template , basePath .Child ("barbican" ).Child ("template" ), r .Namespace )
495+ errors = append (errors , errs ... )
496+ warnings = append (warnings , warns ... )
465497 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Barbican .APIOverride .Route , basePath .Child ("barbican" ).Child ("apiOverride" ).Child ("route" ))... )
466498 }
467499
468500 if r .Spec .Neutron .Enabled {
469501 if old .Neutron .Template == nil {
470502 old .Neutron .Template = & neutronv1.NeutronAPISpecCore {}
471503 }
472- errors = append (errors , r .Spec .Neutron .Template .ValidateUpdate (* old .Neutron .Template , basePath .Child ("neutron" ).Child ("template" ), r .Namespace )... )
504+ warns , errs := r .Spec .Neutron .Template .ValidateUpdate (* old .Neutron .Template , basePath .Child ("neutron" ).Child ("template" ), r .Namespace )
505+ errors = append (errors , errs ... )
506+ warnings = append (warnings , warns ... )
473507 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Neutron .APIOverride .Route , basePath .Child ("neutron" ).Child ("apiOverride" ).Child ("route" ))... )
474508 }
475509
@@ -485,7 +519,9 @@ func (r *OpenStackControlPlane) ValidateUpdateServices(old OpenStackControlPlane
485519 glancev1 .GetCrMaxLengthCorrection (glanceName , glanceAPI .Type )) // omit issue with statefulset pod label "controller-revision-hash": "<statefulset_name>-<hash>"
486520 errors = append (errors , err ... )
487521 }
488- errors = append (errors , r .Spec .Glance .Template .ValidateUpdate (* old .Glance .Template , basePath .Child ("glance" ).Child ("template" ), r .Namespace )... )
522+ warns , errs := r .Spec .Glance .Template .ValidateUpdate (* old .Glance .Template , basePath .Child ("glance" ).Child ("template" ), r .Namespace )
523+ errors = append (errors , errs ... )
524+ warnings = append (warnings , warns ... )
489525
490526 for key , override := range r .Spec .Glance .APIOverride {
491527 overridePath := basePath .Child ("glance" ).Child ("apiOverride" ).Key (key )
@@ -513,15 +549,19 @@ func (r *OpenStackControlPlane) ValidateUpdateServices(old OpenStackControlPlane
513549 if old .Heat .Template == nil {
514550 old .Heat .Template = & heatv1.HeatSpecCore {}
515551 }
516- errors = append (errors , r .Spec .Heat .Template .ValidateUpdate (* old .Heat .Template , basePath .Child ("heat" ).Child ("template" ), r .Namespace )... )
552+ warns , errs := r .Spec .Heat .Template .ValidateUpdate (* old .Heat .Template , basePath .Child ("heat" ).Child ("template" ), r .Namespace )
553+ errors = append (errors , errs ... )
554+ warnings = append (warnings , warns ... )
517555 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Heat .APIOverride .Route , basePath .Child ("heat" ).Child ("apiOverride" ).Child ("route" ))... )
518556 }
519557
520558 if r .Spec .Manila .Enabled {
521559 if old .Manila .Template == nil {
522560 old .Manila .Template = & manilav1.ManilaSpecCore {}
523561 }
524- errors = append (errors , r .Spec .Manila .Template .ValidateUpdate (* old .Manila .Template , basePath .Child ("manila" ).Child ("template" ), r .Namespace )... )
562+ warns , errs := r .Spec .Manila .Template .ValidateUpdate (* old .Manila .Template , basePath .Child ("manila" ).Child ("template" ), r .Namespace )
563+ errors = append (errors , errs ... )
564+ warnings = append (warnings , warns ... )
525565 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Manila .APIOverride .Route , basePath .Child ("manila" ).Child ("apiOverride" ).Child ("route" ))... )
526566 }
527567
@@ -537,30 +577,38 @@ func (r *OpenStackControlPlane) ValidateUpdateServices(old OpenStackControlPlane
537577 if old .Octavia .Template == nil {
538578 old .Octavia .Template = & octaviav1.OctaviaSpecCore {}
539579 }
540- errors = append (errors , r .Spec .Octavia .Template .ValidateUpdate (* old .Octavia .Template , basePath .Child ("octavia" ).Child ("template" ), r .Namespace )... )
580+ warns , errs := r .Spec .Octavia .Template .ValidateUpdate (* old .Octavia .Template , basePath .Child ("octavia" ).Child ("template" ), r .Namespace )
581+ errors = append (errors , errs ... )
582+ warnings = append (warnings , warns ... )
541583 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Octavia .APIOverride .Route , basePath .Child ("octavia" ).Child ("apiOverride" ).Child ("route" ))... )
542584 }
543585
544586 if r .Spec .Designate .Enabled {
545587 if old .Designate .Template == nil {
546588 old .Designate .Template = & designatev1.DesignateSpecCore {}
547589 }
548- errors = append (errors , r .Spec .Designate .Template .ValidateUpdate (* old .Designate .Template , basePath .Child ("designate" ).Child ("template" ), r .Namespace )... )
590+ warns , errs := r .Spec .Designate .Template .ValidateUpdate (* old .Designate .Template , basePath .Child ("designate" ).Child ("template" ), r .Namespace )
591+ errors = append (errors , errs ... )
592+ warnings = append (warnings , warns ... )
549593 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Designate .APIOverride .Route , basePath .Child ("designate" ).Child ("apiOverride" ).Child ("route" ))... )
550594 }
551595
552596 if r .Spec .Watcher .Enabled {
553597 if old .Watcher .Template == nil {
554598 old .Watcher .Template = & watcherv1.WatcherSpecCore {}
555599 }
556- errors = append (errors , r .Spec .Watcher .Template .ValidateUpdate (* old .Watcher .Template , basePath .Child ("watcher" ).Child ("template" ), r .Namespace )... )
600+ warns , errs := r .Spec .Watcher .Template .ValidateUpdate (* old .Watcher .Template , basePath .Child ("watcher" ).Child ("template" ), r .Namespace )
601+ errors = append (errors , errs ... )
602+ warnings = append (warnings , warns ... )
557603 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Watcher .APIOverride .Route , basePath .Child ("watcher" ).Child ("apiOverride" ).Child ("route" ))... )
558604 }
559605 if r .Spec .Telemetry .Enabled {
560606 if old .Telemetry .Template == nil {
561607 old .Telemetry .Template = & telemetryv1.TelemetrySpecCore {}
562608 }
563- errors = append (errors , r .Spec .Telemetry .Template .ValidateUpdate (* old .Telemetry .Template , basePath .Child ("telemetry" ).Child ("template" ), r .Namespace )... )
609+ warns , errs := r .Spec .Telemetry .Template .ValidateUpdate (* old .Telemetry .Template , basePath .Child ("telemetry" ).Child ("template" ), r .Namespace )
610+ errors = append (errors , errs ... )
611+ warnings = append (warnings , warns ... )
564612 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Telemetry .AodhAPIOverride .Route , basePath .Child ("telemetry" ).Child ("aodhApiOverride" ).Child ("route" ))... )
565613 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Telemetry .PrometheusOverride .Route , basePath .Child ("telemetry" ).Child ("prometheusOverride" ).Child ("route" ))... )
566614 errors = append (errors , validateTLSOverrideSpec (& r .Spec .Telemetry .AlertmanagerOverride .Route , basePath .Child ("telemetry" ).Child ("alertmanagerOverride" ).Child ("route" ))... )
0 commit comments