From ef1043962d9185f48cb31b012801315eabe7473d Mon Sep 17 00:00:00 2001 From: Oliver Walsh Date: Tue, 19 Nov 2024 17:38:14 +0000 Subject: [PATCH] Inherit top-level nodeSelector in keystone template --- apis/go.mod | 2 +- apis/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- pkg/openstack/keystone.go | 7 ++++--- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/apis/go.mod b/apis/go.mod index 1c29104a1..5b9740bfb 100644 --- a/apis/go.mod +++ b/apis/go.mod @@ -15,7 +15,7 @@ require ( github.com/openstack-k8s-operators/horizon-operator/api v0.5.1-0.20241119161147-c38568cb3fb0 github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241118112815-d52a058b34a8 github.com/openstack-k8s-operators/ironic-operator/api v0.5.1-0.20241114211630-5b4dcbed9b37 - github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241114094330-6d9f1d45f991 + github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241119162247-18b741090348 github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241114091812-6dc9fd0961dc github.com/openstack-k8s-operators/lib-common/modules/storage v0.5.1-0.20241114091812-6dc9fd0961dc github.com/openstack-k8s-operators/manila-operator/api v0.5.1-0.20241117150431-21b7f58d9ddf diff --git a/apis/go.sum b/apis/go.sum index ec78d8153..65af26406 100644 --- a/apis/go.sum +++ b/apis/go.sum @@ -110,8 +110,8 @@ github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241118112815-d github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241118112815-d52a058b34a8/go.mod h1:6x5zgJJBjrOhsTtNALYrM2ecUH92kIoZbZ6w1fKHPfs= github.com/openstack-k8s-operators/ironic-operator/api v0.5.1-0.20241114211630-5b4dcbed9b37 h1:k++YKQetyZqG6t+kWLhVUclgwLRKspCEyxeEWCeDgjM= github.com/openstack-k8s-operators/ironic-operator/api v0.5.1-0.20241114211630-5b4dcbed9b37/go.mod h1:nKeZBXFCwbYxTpIW9mPs/SK+4cODkEZgs+yOytvafBo= -github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241114094330-6d9f1d45f991 h1:NnE6zREsZ2bYKNdt5Ds8tNv5YOtvUpNFwy7sjzoqoKw= -github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241114094330-6d9f1d45f991/go.mod h1:AZhHY6dZzGyG9iVOf1poD7pTS9c7ZG/f99Fg+GdFVEk= +github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241119162247-18b741090348 h1:mJeXL6JpNWe7d8wA8UZ1EI5T70f8HIgE2ecNjfPFIq4= +github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241119162247-18b741090348/go.mod h1:AZhHY6dZzGyG9iVOf1poD7pTS9c7ZG/f99Fg+GdFVEk= github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241114091812-6dc9fd0961dc h1:Ufa/q/nC9wmKblvsc0kJppsXHOJoY4fbUamb3ItWCOk= github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241114091812-6dc9fd0961dc/go.mod h1:YpNTuJhDWhbXM50O3qBkhO7M+OOyRmWkNVmJ4y3cyFs= github.com/openstack-k8s-operators/lib-common/modules/openstack v0.5.1-0.20241114091812-6dc9fd0961dc h1:q68lNZwCrKgLgcakrDu5VtpiWuC1pzQZKlb1M33EPMI= diff --git a/go.mod b/go.mod index e39130a9b..844659c47 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/openstack-k8s-operators/horizon-operator/api v0.5.1-0.20241119161147-c38568cb3fb0 github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241118112815-d52a058b34a8 github.com/openstack-k8s-operators/ironic-operator/api v0.5.1-0.20241114211630-5b4dcbed9b37 - github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241114094330-6d9f1d45f991 + github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241119162247-18b741090348 github.com/openstack-k8s-operators/lib-common/modules/ansible v0.5.0 github.com/openstack-k8s-operators/lib-common/modules/certmanager v0.5.1-0.20241114091812-6dc9fd0961dc github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241114091812-6dc9fd0961dc diff --git a/go.sum b/go.sum index 2ac379e50..6b68187e0 100644 --- a/go.sum +++ b/go.sum @@ -116,8 +116,8 @@ github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241118112815-d github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241118112815-d52a058b34a8/go.mod h1:6x5zgJJBjrOhsTtNALYrM2ecUH92kIoZbZ6w1fKHPfs= github.com/openstack-k8s-operators/ironic-operator/api v0.5.1-0.20241114211630-5b4dcbed9b37 h1:k++YKQetyZqG6t+kWLhVUclgwLRKspCEyxeEWCeDgjM= github.com/openstack-k8s-operators/ironic-operator/api v0.5.1-0.20241114211630-5b4dcbed9b37/go.mod h1:nKeZBXFCwbYxTpIW9mPs/SK+4cODkEZgs+yOytvafBo= -github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241114094330-6d9f1d45f991 h1:NnE6zREsZ2bYKNdt5Ds8tNv5YOtvUpNFwy7sjzoqoKw= -github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241114094330-6d9f1d45f991/go.mod h1:AZhHY6dZzGyG9iVOf1poD7pTS9c7ZG/f99Fg+GdFVEk= +github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241119162247-18b741090348 h1:mJeXL6JpNWe7d8wA8UZ1EI5T70f8HIgE2ecNjfPFIq4= +github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241119162247-18b741090348/go.mod h1:AZhHY6dZzGyG9iVOf1poD7pTS9c7ZG/f99Fg+GdFVEk= github.com/openstack-k8s-operators/lib-common/modules/ansible v0.5.0 h1:M6tou1UD+en6fcZtV64RPsDVdHH5up6oqtENDU8dRyE= github.com/openstack-k8s-operators/lib-common/modules/ansible v0.5.0/go.mod h1:FxA/2ChDnVKgbZAyiiRLDGZB7WMcrHlOMBZYUQGgRf0= github.com/openstack-k8s-operators/lib-common/modules/certmanager v0.5.1-0.20241114091812-6dc9fd0961dc h1:HrpfpMSk8mnb/fC6TswLxL0RK7u6dw9LbXsFdH+1DCo= diff --git a/pkg/openstack/keystone.go b/pkg/openstack/keystone.go index b74223e36..8b10b103f 100644 --- a/pkg/openstack/keystone.go +++ b/pkg/openstack/keystone.go @@ -103,6 +103,10 @@ func ReconcileKeystoneAPI(ctx context.Context, instance *corev1beta1.OpenStackCo instance.Spec.Keystone.Template.TLS.API.Internal.SecretName = endpointDetails.GetEndptCertSecret(service.EndpointInternal) } + if instance.Spec.Keystone.Template.NodeSelector == nil { + instance.Spec.Keystone.Template.NodeSelector = &instance.Spec.NodeSelector + } + Log.Info("Reconciling KeystoneAPI", "KeystoneAPI.Namespace", instance.Namespace, "KeystoneAPI.Name", "keystone") op, err := controllerutil.CreateOrPatch(ctx, helper.GetClient(), keystoneAPI, func() error { instance.Spec.Keystone.Template.DeepCopyInto(&keystoneAPI.Spec.KeystoneAPISpecCore) @@ -111,9 +115,6 @@ func ReconcileKeystoneAPI(ctx context.Context, instance *corev1beta1.OpenStackCo if keystoneAPI.Spec.Secret == "" { keystoneAPI.Spec.Secret = instance.Spec.Secret } - if keystoneAPI.Spec.NodeSelector == nil && instance.Spec.NodeSelector != nil { - keystoneAPI.Spec.NodeSelector = instance.Spec.NodeSelector - } if keystoneAPI.Spec.DatabaseInstance == "" { //keystoneAPI.Spec.DatabaseInstance = instance.Name // name of MariaDB we create here keystoneAPI.Spec.DatabaseInstance = "openstack" //FIXME: see above