Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inherit top-level nodeSelector in keystone template
Browse files Browse the repository at this point in the history
olliewalsh committed Nov 19, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 4d0fdea commit c818ef4
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion apis/go.mod
Original file line number Diff line number Diff line change
@@ -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.20241114093759-47b4c2e6639e
github.com/openstack-k8s-operators/ironic-operator/api v0.5.1-0.20241114095146-fcfd1c985034
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.20241113144931-ff1fd2dcd04a
github.com/openstack-k8s-operators/lib-common/modules/storage v0.5.1-0.20241104140916-71a0e9d9766d
github.com/openstack-k8s-operators/manila-operator/api v0.5.1-0.20241114094620-1f5a15bf6a50
4 changes: 2 additions & 2 deletions apis/go.sum
Original file line number Diff line number Diff line change
@@ -110,8 +110,8 @@ github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241114093759-4
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241114093759-47b4c2e6639e/go.mod h1:6x5zgJJBjrOhsTtNALYrM2ecUH92kIoZbZ6w1fKHPfs=
github.com/openstack-k8s-operators/ironic-operator/api v0.5.1-0.20241114095146-fcfd1c985034 h1:PtGZ55Oq58Ivt0dBJ0YNybcBe4Pwxc8jT+NbI3QIhnE=
github.com/openstack-k8s-operators/ironic-operator/api v0.5.1-0.20241114095146-fcfd1c985034/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.20241113144931-ff1fd2dcd04a h1:izLb1IVe6pXuQ6Y49CIAkN7yS9qe2fDptRlhxMHSYv4=
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241113144931-ff1fd2dcd04a/go.mod h1:YpNTuJhDWhbXM50O3qBkhO7M+OOyRmWkNVmJ4y3cyFs=
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.5.1-0.20241104140916-71a0e9d9766d h1:Li5NFO947jH8Oe9jZVAhHYWqDaGjBBMx2n8QIIw22GI=
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -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.20241114093759-47b4c2e6639e
github.com/openstack-k8s-operators/ironic-operator/api v0.5.1-0.20241114095146-fcfd1c985034
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.20241104140916-71a0e9d9766d
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241113144931-ff1fd2dcd04a
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -116,8 +116,8 @@ github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241114093759-4
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241114093759-47b4c2e6639e/go.mod h1:6x5zgJJBjrOhsTtNALYrM2ecUH92kIoZbZ6w1fKHPfs=
github.com/openstack-k8s-operators/ironic-operator/api v0.5.1-0.20241114095146-fcfd1c985034 h1:PtGZ55Oq58Ivt0dBJ0YNybcBe4Pwxc8jT+NbI3QIhnE=
github.com/openstack-k8s-operators/ironic-operator/api v0.5.1-0.20241114095146-fcfd1c985034/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.20241104140916-71a0e9d9766d h1:Bq8vsu4SLco9kRClcXflMk9wHEagkXr58MG9u7FmaR4=
7 changes: 4 additions & 3 deletions pkg/openstack/keystone.go
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c818ef4

Please sign in to comment.