Skip to content

Commit a77e2c6

Browse files
committed
Inherit top-level nodeSelector in swift template
1 parent 2439aea commit a77e2c6

7 files changed

Lines changed: 42 additions & 6 deletions

File tree

‎apis/bases/core.openstack.org_openstackcontrolplanes.yaml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14863,6 +14863,10 @@ spec:
1486314863
items:
1486414864
type: string
1486514865
type: array
14866+
nodeSelector:
14867+
additionalProperties:
14868+
type: string
14869+
type: object
1486614870
storageClass:
1486714871
default: ""
1486814872
type: string
@@ -14885,6 +14889,10 @@ spec:
1488514889
items:
1488614890
type: string
1488714891
type: array
14892+
nodeSelector:
14893+
additionalProperties:
14894+
type: string
14895+
type: object
1488814896
override:
1488914897
properties:
1489014898
service:
@@ -14990,6 +14998,10 @@ spec:
1499014998
format: int64
1499114999
minimum: 1
1499215000
type: integer
15001+
nodeSelector:
15002+
additionalProperties:
15003+
type: string
15004+
type: object
1499315005
partPower:
1499415006
default: 10
1499515007
format: int64
@@ -15026,6 +15038,10 @@ spec:
1502615038
items:
1502715039
type: string
1502815040
type: array
15041+
nodeSelector:
15042+
additionalProperties:
15043+
type: string
15044+
type: object
1502915045
replicas:
1503015046
default: 1
1503115047
format: int32

‎apis/go.mod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ require (
2626
github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.5.1-0.20241118111717-a1d460a6d81f
2727
github.com/openstack-k8s-operators/ovn-operator/api v0.5.1-0.20241121095319-a34ad51b8446
2828
github.com/openstack-k8s-operators/placement-operator/api v0.5.1-0.20241119131546-e4c1ba679d22
29-
github.com/openstack-k8s-operators/swift-operator/api v0.5.1-0.20241114094619-107d1aac9458
29+
github.com/openstack-k8s-operators/swift-operator/api v0.5.1-0.20241121093118-6ab57de4e6cc
3030
github.com/openstack-k8s-operators/telemetry-operator/api v0.5.1-0.20241118203716-9550c8740911
3131
github.com/rabbitmq/cluster-operator/v2 v2.11.0
3232
github.com/rhobs/obo-prometheus-operator/pkg/apis/monitoring v0.71.0-rhobs1 // indirect

‎apis/go.sum‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ github.com/openstack-k8s-operators/placement-operator/api v0.5.1-0.2024111913154
136136
github.com/openstack-k8s-operators/placement-operator/api v0.5.1-0.20241119131546-e4c1ba679d22/go.mod h1:3XfvmllEbmTSFzX44Smpq5Ec5nzNAU+aiMgrYKwiXs4=
137137
github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20241017142550-a3524acedd49 h1:/7SnnHfGCH/dwuZFNUx54zw4cnwv2w6hjONq16aoowM=
138138
github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20241017142550-a3524acedd49/go.mod h1:6Mq2N/KtNFW20L+PQC5qkeK8R8UGadmGBXL8HDY6lcg=
139-
github.com/openstack-k8s-operators/swift-operator/api v0.5.1-0.20241114094619-107d1aac9458 h1:jLM1a3sClYUKfWHdZzTZI9RIpJGA+H8XQh321CbO0D0=
140-
github.com/openstack-k8s-operators/swift-operator/api v0.5.1-0.20241114094619-107d1aac9458/go.mod h1:JlOTO8hnn/RCDtmZXAvnpudqv38eEFGX6nbfwEbltv8=
139+
github.com/openstack-k8s-operators/swift-operator/api v0.5.1-0.20241121093118-6ab57de4e6cc h1:ObbwXZbbXk+PQpYPZWmisdwzQaSHv9Lyk1juBLJctnM=
140+
github.com/openstack-k8s-operators/swift-operator/api v0.5.1-0.20241121093118-6ab57de4e6cc/go.mod h1:JlOTO8hnn/RCDtmZXAvnpudqv38eEFGX6nbfwEbltv8=
141141
github.com/openstack-k8s-operators/telemetry-operator/api v0.5.1-0.20241118203716-9550c8740911 h1:4OysgPT+NOnOtC7dAKc9xdHLnVdEMz6JYDwFd6w3fxI=
142142
github.com/openstack-k8s-operators/telemetry-operator/api v0.5.1-0.20241118203716-9550c8740911/go.mod h1:wpC0oQUkW/a/BjgzZOEwknnKJxHY0DeAIqtAh7WNwSs=
143143
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=

‎config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14863,6 +14863,10 @@ spec:
1486314863
items:
1486414864
type: string
1486514865
type: array
14866+
nodeSelector:
14867+
additionalProperties:
14868+
type: string
14869+
type: object
1486614870
storageClass:
1486714871
default: ""
1486814872
type: string
@@ -14885,6 +14889,10 @@ spec:
1488514889
items:
1488614890
type: string
1488714891
type: array
14892+
nodeSelector:
14893+
additionalProperties:
14894+
type: string
14895+
type: object
1488814896
override:
1488914897
properties:
1489014898
service:
@@ -14990,6 +14998,10 @@ spec:
1499014998
format: int64
1499114999
minimum: 1
1499215000
type: integer
15001+
nodeSelector:
15002+
additionalProperties:
15003+
type: string
15004+
type: object
1499315005
partPower:
1499415006
default: 10
1499515007
format: int64
@@ -15026,6 +15038,10 @@ spec:
1502615038
items:
1502715039
type: string
1502815040
type: array
15041+
nodeSelector:
15042+
additionalProperties:
15043+
type: string
15044+
type: object
1502915045
replicas:
1503015046
default: 1
1503115047
format: int32

‎go.mod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ require (
3636
github.com/openstack-k8s-operators/openstack-operator/apis v0.0.0-20240531084739-3b4c0451297c
3737
github.com/openstack-k8s-operators/ovn-operator/api v0.5.1-0.20241121095319-a34ad51b8446
3838
github.com/openstack-k8s-operators/placement-operator/api v0.5.1-0.20241119131546-e4c1ba679d22
39-
github.com/openstack-k8s-operators/swift-operator/api v0.5.1-0.20241114094619-107d1aac9458
39+
github.com/openstack-k8s-operators/swift-operator/api v0.5.1-0.20241121093118-6ab57de4e6cc
4040
github.com/openstack-k8s-operators/telemetry-operator/api v0.5.1-0.20241118203716-9550c8740911
4141
github.com/openstack-k8s-operators/test-operator/api v0.5.1-0.20241118150825-cd41d06be047
4242
github.com/rabbitmq/cluster-operator/v2 v2.11.0

‎go.sum‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ github.com/openstack-k8s-operators/placement-operator/api v0.5.1-0.2024111913154
148148
github.com/openstack-k8s-operators/placement-operator/api v0.5.1-0.20241119131546-e4c1ba679d22/go.mod h1:3XfvmllEbmTSFzX44Smpq5Ec5nzNAU+aiMgrYKwiXs4=
149149
github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20241017142550-a3524acedd49 h1:/7SnnHfGCH/dwuZFNUx54zw4cnwv2w6hjONq16aoowM=
150150
github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20241017142550-a3524acedd49/go.mod h1:6Mq2N/KtNFW20L+PQC5qkeK8R8UGadmGBXL8HDY6lcg=
151-
github.com/openstack-k8s-operators/swift-operator/api v0.5.1-0.20241114094619-107d1aac9458 h1:jLM1a3sClYUKfWHdZzTZI9RIpJGA+H8XQh321CbO0D0=
152-
github.com/openstack-k8s-operators/swift-operator/api v0.5.1-0.20241114094619-107d1aac9458/go.mod h1:JlOTO8hnn/RCDtmZXAvnpudqv38eEFGX6nbfwEbltv8=
151+
github.com/openstack-k8s-operators/swift-operator/api v0.5.1-0.20241121093118-6ab57de4e6cc h1:ObbwXZbbXk+PQpYPZWmisdwzQaSHv9Lyk1juBLJctnM=
152+
github.com/openstack-k8s-operators/swift-operator/api v0.5.1-0.20241121093118-6ab57de4e6cc/go.mod h1:JlOTO8hnn/RCDtmZXAvnpudqv38eEFGX6nbfwEbltv8=
153153
github.com/openstack-k8s-operators/telemetry-operator/api v0.5.1-0.20241118203716-9550c8740911 h1:4OysgPT+NOnOtC7dAKc9xdHLnVdEMz6JYDwFd6w3fxI=
154154
github.com/openstack-k8s-operators/telemetry-operator/api v0.5.1-0.20241118203716-9550c8740911/go.mod h1:wpC0oQUkW/a/BjgzZOEwknnKJxHY0DeAIqtAh7WNwSs=
155155
github.com/openstack-k8s-operators/test-operator/api v0.5.1-0.20241118150825-cd41d06be047 h1:7fq7Zl2uFWHLWc4CLvEBEuIvKLO0JYDrqBZ1wtDfBQ8=

‎pkg/openstack/swift.go‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ func ReconcileSwift(ctx context.Context, instance *corev1beta1.OpenStackControlP
4646
instance.Spec.Swift.Template = &swiftv1.SwiftSpecCore{}
4747
}
4848

49+
if instance.Spec.Swift.Template.NodeSelector == nil {
50+
instance.Spec.Swift.Template.NodeSelector = &instance.Spec.NodeSelector
51+
}
52+
4953
// add selector to service overrides
5054
for _, endpointType := range []service.Endpoint{service.EndpointPublic, service.EndpointInternal} {
5155
if instance.Spec.Swift.Template.SwiftProxy.Override.Service == nil {

0 commit comments

Comments
 (0)