Skip to content

Commit

Permalink
Merge pull request #1188 from olliewalsh/placement_nodeselector
Browse files Browse the repository at this point in the history
Inherit top-level nodeSelector in placement, horizon, keystone template
  • Loading branch information
openshift-merge-bot[bot] authored Nov 20, 2024
2 parents 39f1821 + ef10439 commit dfc0ead
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 24 deletions.
6 changes: 3 additions & 3 deletions apis/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ require (
github.com/openstack-k8s-operators/designate-operator/api v0.5.1-0.20241114094900-9ce3c64786da
github.com/openstack-k8s-operators/glance-operator/api v0.5.1-0.20241114111414-1fdd7f486264
github.com/openstack-k8s-operators/heat-operator/api v0.5.1-0.20241118124230-6202fa6a0fee
github.com/openstack-k8s-operators/horizon-operator/api v0.5.1-0.20241114094043-66396cca1abf
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
Expand All @@ -25,7 +25,7 @@ require (
github.com/openstack-k8s-operators/octavia-operator/api v0.5.1-0.20241115111947-2336829c2d73
github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.5.1-0.20241118111717-a1d460a6d81f
github.com/openstack-k8s-operators/ovn-operator/api v0.5.1-0.20241118072048-45d5df9ad730
github.com/openstack-k8s-operators/placement-operator/api v0.5.1-0.20241114101059-9566e1fd30de
github.com/openstack-k8s-operators/placement-operator/api v0.5.1-0.20241119131546-e4c1ba679d22
github.com/openstack-k8s-operators/swift-operator/api v0.5.1-0.20241114094619-107d1aac9458
github.com/openstack-k8s-operators/telemetry-operator/api v0.5.1-0.20241118203716-9550c8740911
github.com/rabbitmq/cluster-operator/v2 v2.11.0
Expand Down
12 changes: 6 additions & 6 deletions apis/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ github.com/openstack-k8s-operators/glance-operator/api v0.5.1-0.20241114111414-1
github.com/openstack-k8s-operators/glance-operator/api v0.5.1-0.20241114111414-1fdd7f486264/go.mod h1:bRqpa/WUQ7D99SAOXEPItxBobRP1oVUo93PWQukChIs=
github.com/openstack-k8s-operators/heat-operator/api v0.5.1-0.20241118124230-6202fa6a0fee h1:bQzR5hdF/5KN/HVD73i0vrQSlsdBCg1eOXfKeJtXfTE=
github.com/openstack-k8s-operators/heat-operator/api v0.5.1-0.20241118124230-6202fa6a0fee/go.mod h1:PuXjq4bV3/mYo4OAD/4tTon0N7E9YYXZHWiZLeZFVek=
github.com/openstack-k8s-operators/horizon-operator/api v0.5.1-0.20241114094043-66396cca1abf h1:ZNttb7z+8vPXpmqsintXxxNSP1s8PWukND2oLPepJ4w=
github.com/openstack-k8s-operators/horizon-operator/api v0.5.1-0.20241114094043-66396cca1abf/go.mod h1:ezxV+6xd12IRKespGaDlJCUQ301yxrBlQUCEbeYQgSA=
github.com/openstack-k8s-operators/horizon-operator/api v0.5.1-0.20241119161147-c38568cb3fb0 h1:YtC+hqGKx9M8B6fHgA1eFlq1yjEiOWwp1zZqyFtjSbA=
github.com/openstack-k8s-operators/horizon-operator/api v0.5.1-0.20241119161147-c38568cb3fb0/go.mod h1:ezxV+6xd12IRKespGaDlJCUQ301yxrBlQUCEbeYQgSA=
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241118112815-d52a058b34a8 h1:mmnunGX3tnIT4ErxFjYcKb38VLjnfe9JcIcU9LaW9rE=
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=
Expand All @@ -132,8 +132,8 @@ github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.5.1-0.202
github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.5.1-0.20241118111717-a1d460a6d81f/go.mod h1:G9nampuSFs/9i2Ldx3OasU6oehWchwYuhBu1qMWktMg=
github.com/openstack-k8s-operators/ovn-operator/api v0.5.1-0.20241118072048-45d5df9ad730 h1:unZ61c7+dUAALmQHRAVuqqmaTU0Ga5QeU53a4VXwtQU=
github.com/openstack-k8s-operators/ovn-operator/api v0.5.1-0.20241118072048-45d5df9ad730/go.mod h1:q5nvyCqRoCM9y6s/n8GfrBUzsGJltCEy8C1usKtkeJA=
github.com/openstack-k8s-operators/placement-operator/api v0.5.1-0.20241114101059-9566e1fd30de h1:DPSV/DNXGlevgssV0POKZqRXKels5/Y+xQ8EOtw+eHE=
github.com/openstack-k8s-operators/placement-operator/api v0.5.1-0.20241114101059-9566e1fd30de/go.mod h1:3XfvmllEbmTSFzX44Smpq5Ec5nzNAU+aiMgrYKwiXs4=
github.com/openstack-k8s-operators/placement-operator/api v0.5.1-0.20241119131546-e4c1ba679d22 h1:/53HgWuy6ZeqDVHevrv8dINctLF5/NY94LG+lKtDP08=
github.com/openstack-k8s-operators/placement-operator/api v0.5.1-0.20241119131546-e4c1ba679d22/go.mod h1:3XfvmllEbmTSFzX44Smpq5Ec5nzNAU+aiMgrYKwiXs4=
github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20241017142550-a3524acedd49 h1:/7SnnHfGCH/dwuZFNUx54zw4cnwv2w6hjONq16aoowM=
github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20241017142550-a3524acedd49/go.mod h1:6Mq2N/KtNFW20L+PQC5qkeK8R8UGadmGBXL8HDY6lcg=
github.com/openstack-k8s-operators/swift-operator/api v0.5.1-0.20241114094619-107d1aac9458 h1:jLM1a3sClYUKfWHdZzTZI9RIpJGA+H8XQh321CbO0D0=
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ require (
github.com/openstack-k8s-operators/designate-operator/api v0.5.1-0.20241114094900-9ce3c64786da
github.com/openstack-k8s-operators/glance-operator/api v0.5.1-0.20241114111414-1fdd7f486264
github.com/openstack-k8s-operators/heat-operator/api v0.5.1-0.20241118124230-6202fa6a0fee
github.com/openstack-k8s-operators/horizon-operator/api v0.5.1-0.20241114094043-66396cca1abf
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
Expand All @@ -35,7 +35,7 @@ require (
github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.5.1-0.20241118111717-a1d460a6d81f
github.com/openstack-k8s-operators/openstack-operator/apis v0.0.0-20240531084739-3b4c0451297c
github.com/openstack-k8s-operators/ovn-operator/api v0.5.1-0.20241118072048-45d5df9ad730
github.com/openstack-k8s-operators/placement-operator/api v0.5.1-0.20241114101059-9566e1fd30de
github.com/openstack-k8s-operators/placement-operator/api v0.5.1-0.20241119131546-e4c1ba679d22
github.com/openstack-k8s-operators/swift-operator/api v0.5.1-0.20241114094619-107d1aac9458
github.com/openstack-k8s-operators/telemetry-operator/api v0.5.1-0.20241118203716-9550c8740911
github.com/openstack-k8s-operators/test-operator/api v0.5.1-0.20241118150825-cd41d06be047
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@ github.com/openstack-k8s-operators/glance-operator/api v0.5.1-0.20241114111414-1
github.com/openstack-k8s-operators/glance-operator/api v0.5.1-0.20241114111414-1fdd7f486264/go.mod h1:bRqpa/WUQ7D99SAOXEPItxBobRP1oVUo93PWQukChIs=
github.com/openstack-k8s-operators/heat-operator/api v0.5.1-0.20241118124230-6202fa6a0fee h1:bQzR5hdF/5KN/HVD73i0vrQSlsdBCg1eOXfKeJtXfTE=
github.com/openstack-k8s-operators/heat-operator/api v0.5.1-0.20241118124230-6202fa6a0fee/go.mod h1:PuXjq4bV3/mYo4OAD/4tTon0N7E9YYXZHWiZLeZFVek=
github.com/openstack-k8s-operators/horizon-operator/api v0.5.1-0.20241114094043-66396cca1abf h1:ZNttb7z+8vPXpmqsintXxxNSP1s8PWukND2oLPepJ4w=
github.com/openstack-k8s-operators/horizon-operator/api v0.5.1-0.20241114094043-66396cca1abf/go.mod h1:ezxV+6xd12IRKespGaDlJCUQ301yxrBlQUCEbeYQgSA=
github.com/openstack-k8s-operators/horizon-operator/api v0.5.1-0.20241119161147-c38568cb3fb0 h1:YtC+hqGKx9M8B6fHgA1eFlq1yjEiOWwp1zZqyFtjSbA=
github.com/openstack-k8s-operators/horizon-operator/api v0.5.1-0.20241119161147-c38568cb3fb0/go.mod h1:ezxV+6xd12IRKespGaDlJCUQ301yxrBlQUCEbeYQgSA=
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241118112815-d52a058b34a8 h1:mmnunGX3tnIT4ErxFjYcKb38VLjnfe9JcIcU9LaW9rE=
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=
Expand All @@ -144,8 +144,8 @@ github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.5.1-0.202
github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.5.1-0.20241118111717-a1d460a6d81f/go.mod h1:G9nampuSFs/9i2Ldx3OasU6oehWchwYuhBu1qMWktMg=
github.com/openstack-k8s-operators/ovn-operator/api v0.5.1-0.20241118072048-45d5df9ad730 h1:unZ61c7+dUAALmQHRAVuqqmaTU0Ga5QeU53a4VXwtQU=
github.com/openstack-k8s-operators/ovn-operator/api v0.5.1-0.20241118072048-45d5df9ad730/go.mod h1:q5nvyCqRoCM9y6s/n8GfrBUzsGJltCEy8C1usKtkeJA=
github.com/openstack-k8s-operators/placement-operator/api v0.5.1-0.20241114101059-9566e1fd30de h1:DPSV/DNXGlevgssV0POKZqRXKels5/Y+xQ8EOtw+eHE=
github.com/openstack-k8s-operators/placement-operator/api v0.5.1-0.20241114101059-9566e1fd30de/go.mod h1:3XfvmllEbmTSFzX44Smpq5Ec5nzNAU+aiMgrYKwiXs4=
github.com/openstack-k8s-operators/placement-operator/api v0.5.1-0.20241119131546-e4c1ba679d22 h1:/53HgWuy6ZeqDVHevrv8dINctLF5/NY94LG+lKtDP08=
github.com/openstack-k8s-operators/placement-operator/api v0.5.1-0.20241119131546-e4c1ba679d22/go.mod h1:3XfvmllEbmTSFzX44Smpq5Ec5nzNAU+aiMgrYKwiXs4=
github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20241017142550-a3524acedd49 h1:/7SnnHfGCH/dwuZFNUx54zw4cnwv2w6hjONq16aoowM=
github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20241017142550-a3524acedd49/go.mod h1:6Mq2N/KtNFW20L+PQC5qkeK8R8UGadmGBXL8HDY6lcg=
github.com/openstack-k8s-operators/swift-operator/api v0.5.1-0.20241114094619-107d1aac9458 h1:jLM1a3sClYUKfWHdZzTZI9RIpJGA+H8XQh321CbO0D0=
Expand Down
4 changes: 4 additions & 0 deletions pkg/openstack/horizon.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ func ReconcileHorizon(ctx context.Context, instance *corev1beta1.OpenStackContro
instance.Spec.Horizon.Template = &horizonv1.HorizonSpecCore{}
}

if instance.Spec.Horizon.Template.NodeSelector == nil {
instance.Spec.Horizon.Template.NodeSelector = &instance.Spec.NodeSelector
}

// add selector to service overrides
serviceOverrides := map[service.Endpoint]service.RoutedOverrideSpec{}
if instance.Spec.Horizon.Template.Override.Service != nil {
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
7 changes: 4 additions & 3 deletions pkg/openstack/placement.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ func ReconcilePlacementAPI(ctx context.Context, instance *corev1beta1.OpenStackC
instance.Spec.Placement.Template = &placementv1.PlacementAPISpecCore{}
}

if instance.Spec.Placement.Template.NodeSelector == nil {
instance.Spec.Placement.Template.NodeSelector = &instance.Spec.NodeSelector
}

// add selector to service overrides
for _, endpointType := range []service.Endpoint{service.EndpointPublic, service.EndpointInternal} {
if instance.Spec.Placement.Template.Override.Service == nil {
Expand Down Expand Up @@ -108,9 +112,6 @@ func ReconcilePlacementAPI(ctx context.Context, instance *corev1beta1.OpenStackC
if placementAPI.Spec.Secret == "" {
placementAPI.Spec.Secret = instance.Spec.Secret
}
if placementAPI.Spec.NodeSelector == nil && instance.Spec.NodeSelector != nil {
placementAPI.Spec.NodeSelector = instance.Spec.NodeSelector
}
if placementAPI.Spec.DatabaseInstance == "" {
placementAPI.Spec.DatabaseInstance = "openstack"
}
Expand Down

0 comments on commit dfc0ead

Please sign in to comment.