File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 66
77 "github.com/openstack-k8s-operators/lib-common/modules/common/condition"
88 "github.com/openstack-k8s-operators/lib-common/modules/common/helper"
9+ "github.com/openstack-k8s-operators/lib-common/modules/common/route"
910 "github.com/openstack-k8s-operators/lib-common/modules/common/service"
1011 "github.com/openstack-k8s-operators/lib-common/modules/common/tls"
1112
@@ -82,6 +83,20 @@ func ReconcileHorizon(ctx context.Context, instance *corev1beta1.OpenStackContro
8283 //
8384 apiOverrides := instance .Spec .Horizon .APIOverride
8485
86+ // Initialize Route if nil
87+ if apiOverrides .Route == nil {
88+ apiOverrides .Route = & route.OverrideSpec {}
89+ }
90+
91+ if apiOverrides .Route .EmbeddedLabelsAnnotations == nil {
92+ apiOverrides .Route .EmbeddedLabelsAnnotations = & route.EmbeddedLabelsAnnotations {}
93+ }
94+
95+ // Initialize the annotations map if it is nil
96+ if apiOverrides .Route .Annotations == nil {
97+ apiOverrides .Route .Annotations = map [string ]string {}
98+ }
99+
85100 if _ , ok := apiOverrides .Route .Annotations [HorizonHSTSHeaderAnnotation ]; ! ok {
86101 apiOverrides .Route .Annotations [HorizonHSTSHeaderAnnotation ] = HorizonHSTSHeaderAnnotationValue
87102 }
You can’t perform that action at this time.
0 commit comments