Skip to content

Commit

Permalink
Inherit top-level nodeSelector in keystone template
Browse files Browse the repository at this point in the history
  • Loading branch information
olliewalsh committed Nov 22, 2024
1 parent 4c91b85 commit 4058189
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 9 deletions.
8 changes: 8 additions & 0 deletions apis/bases/core.openstack.org_openstackcontrolplanes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7286,6 +7286,14 @@ spec:
format: int32
minimum: 1
type: integer
httpdCustomization:
properties:
processNumber:
default: 3
format: int32
minimum: 1
type: integer
type: object
memcachedInstance:
default: memcached
type: string
Expand Down
2 changes: 1 addition & 1 deletion apis/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/openstack-k8s-operators/horizon-operator/api v0.5.1-0.20241122125601-2e200c1224ce
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241120213010-335e32b1dc65
github.com/openstack-k8s-operators/ironic-operator/api v0.5.0
github.com/openstack-k8s-operators/keystone-operator/api v0.5.0
github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241122131229-de8969562e62
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.0
github.com/openstack-k8s-operators/lib-common/modules/storage v0.5.0
github.com/openstack-k8s-operators/manila-operator/api v0.5.0
Expand Down
4 changes: 2 additions & 2 deletions apis/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241120213010-3
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241120213010-335e32b1dc65/go.mod h1:J9oUh3eGBvAFfyUMiPxPRBSxAcO8rnwITN4RTh/It+8=
github.com/openstack-k8s-operators/ironic-operator/api v0.5.0 h1:vbuylOv7NOkpjCD1BS2Bhyg2fMxJyuagXmg8jr61UCk=
github.com/openstack-k8s-operators/ironic-operator/api v0.5.0/go.mod h1:qxdXTRt7kY6orSnFc/OTRHtqElNPuMV0W0KvMPHbE2s=
github.com/openstack-k8s-operators/keystone-operator/api v0.5.0 h1:h/Ce2OjdNrkDh/rJuZPdOsxrsm2uC+E57Mmf34oyWR0=
github.com/openstack-k8s-operators/keystone-operator/api v0.5.0/go.mod h1:saoorrsPo3DzDPGM6PJ8sQJBNuNRGCHjRHChRQmkoQ0=
github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241122131229-de8969562e62 h1:CIQGR9XLRj+kUPplJTWmKnp4EjeN0qzGrk5RdK1ZpfU=
github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241122131229-de8969562e62/go.mod h1:saoorrsPo3DzDPGM6PJ8sQJBNuNRGCHjRHChRQmkoQ0=
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.0 h1:wto7Vprhr84z2LJzjbbw589MGkfjKtpHnhIhzgOa+BI=
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.0/go.mod h1:tNeup9Xl7j2eaeMslJ/rt59NNEAw7ATf6RuebS/YkSk=
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.4.1-0.20241014140317-e5c35d28f3af h1:fevDUHmqcnI4wDTKupKe/CcgVdgNpZXWkJx8u0/xEXs=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7286,6 +7286,14 @@ spec:
format: int32
minimum: 1
type: integer
httpdCustomization:
properties:
processNumber:
default: 3
format: int32
minimum: 1
type: integer
type: object
memcachedInstance:
default: memcached
type: string
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/openstack-k8s-operators/horizon-operator/api v0.5.1-0.20241122125601-2e200c1224ce
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241120213010-335e32b1dc65
github.com/openstack-k8s-operators/ironic-operator/api v0.5.0
github.com/openstack-k8s-operators/keystone-operator/api v0.5.0
github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241122131229-de8969562e62
github.com/openstack-k8s-operators/lib-common/modules/ansible v0.5.0
github.com/openstack-k8s-operators/lib-common/modules/certmanager v0.5.0
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241120213010-3
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241120213010-335e32b1dc65/go.mod h1:J9oUh3eGBvAFfyUMiPxPRBSxAcO8rnwITN4RTh/It+8=
github.com/openstack-k8s-operators/ironic-operator/api v0.5.0 h1:vbuylOv7NOkpjCD1BS2Bhyg2fMxJyuagXmg8jr61UCk=
github.com/openstack-k8s-operators/ironic-operator/api v0.5.0/go.mod h1:qxdXTRt7kY6orSnFc/OTRHtqElNPuMV0W0KvMPHbE2s=
github.com/openstack-k8s-operators/keystone-operator/api v0.5.0 h1:h/Ce2OjdNrkDh/rJuZPdOsxrsm2uC+E57Mmf34oyWR0=
github.com/openstack-k8s-operators/keystone-operator/api v0.5.0/go.mod h1:saoorrsPo3DzDPGM6PJ8sQJBNuNRGCHjRHChRQmkoQ0=
github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241122131229-de8969562e62 h1:CIQGR9XLRj+kUPplJTWmKnp4EjeN0qzGrk5RdK1ZpfU=
github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241122131229-de8969562e62/go.mod h1:saoorrsPo3DzDPGM6PJ8sQJBNuNRGCHjRHChRQmkoQ0=
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.0 h1:Y2wAPS3TBQrjSbTrbtCjJUYL2spltyyjfzQ3bF7DRZ8=
Expand Down
7 changes: 4 additions & 3 deletions pkg/openstack/keystone.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 4058189

Please sign in to comment.