Skip to content

Commit d9b3e9d

Browse files
committed
Inherit top-level nodeSelector in cinder template
1 parent dfc0ead commit d9b3e9d

5 files changed

Lines changed: 10 additions & 9 deletions

File tree

apis/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/onsi/ginkgo/v2 v2.20.1
99
github.com/onsi/gomega v1.34.1
1010
github.com/openstack-k8s-operators/barbican-operator/api v0.5.1-0.20241114094618-6febb2d8d6a4
11-
github.com/openstack-k8s-operators/cinder-operator/api v0.5.1-0.20241114094619-8cd575ca0e60
11+
github.com/openstack-k8s-operators/cinder-operator/api v0.5.1-0.20241120063916-9e97663361d3
1212
github.com/openstack-k8s-operators/designate-operator/api v0.5.1-0.20241114094900-9ce3c64786da
1313
github.com/openstack-k8s-operators/glance-operator/api v0.5.1-0.20241114111414-1fdd7f486264
1414
github.com/openstack-k8s-operators/heat-operator/api v0.5.1-0.20241118124230-6202fa6a0fee

apis/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ github.com/openshift/api v0.0.0-20240830023148-b7d0481c9094 h1:J1wuGhVxpsHykZBa6
9696
github.com/openshift/api v0.0.0-20240830023148-b7d0481c9094/go.mod h1:CxgbWAlvu2iQB0UmKTtRu1YfepRg1/vJ64n2DlIEVz4=
9797
github.com/openstack-k8s-operators/barbican-operator/api v0.5.1-0.20241114094618-6febb2d8d6a4 h1:vMsxll0P87Gzght042PytRTx5c71hlQLhux/peHONmk=
9898
github.com/openstack-k8s-operators/barbican-operator/api v0.5.1-0.20241114094618-6febb2d8d6a4/go.mod h1:Xn5DqgDkAT61fI88mBHsMfyzD4xNh0dYcSI90B3Io08=
99-
github.com/openstack-k8s-operators/cinder-operator/api v0.5.1-0.20241114094619-8cd575ca0e60 h1:kpojOnJkO8mC962fidyCUDwayju8U9NPkmScYfQ9dxA=
100-
github.com/openstack-k8s-operators/cinder-operator/api v0.5.1-0.20241114094619-8cd575ca0e60/go.mod h1:3NvCHOoCyzcZm046XctbsU/Dx+en3l8jG3nHhZyWOAA=
99+
github.com/openstack-k8s-operators/cinder-operator/api v0.5.1-0.20241120063916-9e97663361d3 h1:oIlRFU4i2OTxUC3gH88KdwtihbQbSS6deNUpaqSSC6M=
100+
github.com/openstack-k8s-operators/cinder-operator/api v0.5.1-0.20241120063916-9e97663361d3/go.mod h1:3NvCHOoCyzcZm046XctbsU/Dx+en3l8jG3nHhZyWOAA=
101101
github.com/openstack-k8s-operators/designate-operator/api v0.5.1-0.20241114094900-9ce3c64786da h1:f2jFQsWopZfBoiI4mIlO7RpGRJ+QYYlfQhy9X7f5Bns=
102102
github.com/openstack-k8s-operators/designate-operator/api v0.5.1-0.20241114094900-9ce3c64786da/go.mod h1:JZSzHp6f07mYkRB71xamFIPlgbFKvzIbv68ttwsEt/o=
103103
github.com/openstack-k8s-operators/glance-operator/api v0.5.1-0.20241114111414-1fdd7f486264 h1:gQXtUfjK1Nj2tSBwarVUlJXEWUiYgu2ovMWEtTBvC4Y=

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ require (
1414
github.com/onsi/gomega v1.34.1
1515
github.com/openshift/api v3.9.0+incompatible
1616
github.com/openstack-k8s-operators/barbican-operator/api v0.5.1-0.20241114094618-6febb2d8d6a4
17-
github.com/openstack-k8s-operators/cinder-operator/api v0.5.1-0.20241114094619-8cd575ca0e60
17+
github.com/openstack-k8s-operators/cinder-operator/api v0.5.1-0.20241120063916-9e97663361d3
1818
github.com/openstack-k8s-operators/designate-operator/api v0.5.1-0.20241114094900-9ce3c64786da
1919
github.com/openstack-k8s-operators/glance-operator/api v0.5.1-0.20241114111414-1fdd7f486264
2020
github.com/openstack-k8s-operators/heat-operator/api v0.5.1-0.20241118124230-6202fa6a0fee

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ github.com/openshift/api v0.0.0-20240830023148-b7d0481c9094 h1:J1wuGhVxpsHykZBa6
102102
github.com/openshift/api v0.0.0-20240830023148-b7d0481c9094/go.mod h1:CxgbWAlvu2iQB0UmKTtRu1YfepRg1/vJ64n2DlIEVz4=
103103
github.com/openstack-k8s-operators/barbican-operator/api v0.5.1-0.20241114094618-6febb2d8d6a4 h1:vMsxll0P87Gzght042PytRTx5c71hlQLhux/peHONmk=
104104
github.com/openstack-k8s-operators/barbican-operator/api v0.5.1-0.20241114094618-6febb2d8d6a4/go.mod h1:Xn5DqgDkAT61fI88mBHsMfyzD4xNh0dYcSI90B3Io08=
105-
github.com/openstack-k8s-operators/cinder-operator/api v0.5.1-0.20241114094619-8cd575ca0e60 h1:kpojOnJkO8mC962fidyCUDwayju8U9NPkmScYfQ9dxA=
106-
github.com/openstack-k8s-operators/cinder-operator/api v0.5.1-0.20241114094619-8cd575ca0e60/go.mod h1:3NvCHOoCyzcZm046XctbsU/Dx+en3l8jG3nHhZyWOAA=
105+
github.com/openstack-k8s-operators/cinder-operator/api v0.5.1-0.20241120063916-9e97663361d3 h1:oIlRFU4i2OTxUC3gH88KdwtihbQbSS6deNUpaqSSC6M=
106+
github.com/openstack-k8s-operators/cinder-operator/api v0.5.1-0.20241120063916-9e97663361d3/go.mod h1:3NvCHOoCyzcZm046XctbsU/Dx+en3l8jG3nHhZyWOAA=
107107
github.com/openstack-k8s-operators/designate-operator/api v0.5.1-0.20241114094900-9ce3c64786da h1:f2jFQsWopZfBoiI4mIlO7RpGRJ+QYYlfQhy9X7f5Bns=
108108
github.com/openstack-k8s-operators/designate-operator/api v0.5.1-0.20241114094900-9ce3c64786da/go.mod h1:JZSzHp6f07mYkRB71xamFIPlgbFKvzIbv68ttwsEt/o=
109109
github.com/openstack-k8s-operators/glance-operator/api v0.5.1-0.20241114111414-1fdd7f486264 h1:gQXtUfjK1Nj2tSBwarVUlJXEWUiYgu2ovMWEtTBvC4Y=

pkg/openstack/cinder.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ func ReconcileCinder(ctx context.Context, instance *corev1beta1.OpenStackControl
118118
instance.Spec.Cinder.Template.CinderAPI.TLS.API.Internal.SecretName = endpointDetails.GetEndptCertSecret(service.EndpointInternal)
119119
}
120120

121+
if instance.Spec.Cinder.Template.NodeSelector == nil {
122+
instance.Spec.Cinder.Template.NodeSelector = &instance.Spec.NodeSelector
123+
}
124+
121125
Log.Info("Reconciling Cinder", "Cinder.Namespace", instance.Namespace, "Cinder.Name", cinderName)
122126
op, err := controllerutil.CreateOrPatch(ctx, helper.GetClient(), cinder, func() error {
123127
instance.Spec.Cinder.Template.CinderSpecBase.DeepCopyInto(&cinder.Spec.CinderSpecBase)
@@ -151,9 +155,6 @@ func ReconcileCinder(ctx context.Context, instance *corev1beta1.OpenStackControl
151155
if cinder.Spec.Secret == "" {
152156
cinder.Spec.Secret = instance.Spec.Secret
153157
}
154-
if cinder.Spec.NodeSelector == nil && instance.Spec.NodeSelector != nil {
155-
cinder.Spec.NodeSelector = instance.Spec.NodeSelector
156-
}
157158
if cinder.Spec.DatabaseInstance == "" {
158159
//cinder.Spec.DatabaseInstance = instance.Name // name of MariaDB we create here
159160
cinder.Spec.DatabaseInstance = "openstack" //FIXME: see above

0 commit comments

Comments
 (0)