Skip to content

Commit afeaf29

Browse files
committed
Inherit top-level nodeSelector in dnsmasq, memcache, redis template
1 parent bacaf8d commit afeaf29

9 files changed

Lines changed: 26 additions & 9 deletions

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14703,6 +14703,10 @@ spec:
1470314703
templates:
1470414704
additionalProperties:
1470514705
properties:
14706+
nodeSelector:
14707+
additionalProperties:
14708+
type: string
14709+
type: object
1470614710
replicas:
1470714711
default: 1
1470814712
format: int32

‎apis/go.mod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/openstack-k8s-operators/glance-operator/api v0.5.1-0.20241120062804-89e9fe93e886
1414
github.com/openstack-k8s-operators/heat-operator/api v0.5.1-0.20241120140156-1c476cfe7c63
1515
github.com/openstack-k8s-operators/horizon-operator/api v0.5.1-0.20241119161147-c38568cb3fb0
16-
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241118112815-d52a058b34a8
16+
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241120235143-b225194fd0fd
1717
github.com/openstack-k8s-operators/ironic-operator/api v0.5.1-0.20241114211630-5b4dcbed9b37
1818
github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241119162247-18b741090348
1919
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241114091812-6dc9fd0961dc

‎apis/go.sum‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ github.com/openstack-k8s-operators/heat-operator/api v0.5.1-0.20241120140156-1c4
106106
github.com/openstack-k8s-operators/heat-operator/api v0.5.1-0.20241120140156-1c476cfe7c63/go.mod h1:PuXjq4bV3/mYo4OAD/4tTon0N7E9YYXZHWiZLeZFVek=
107107
github.com/openstack-k8s-operators/horizon-operator/api v0.5.1-0.20241119161147-c38568cb3fb0 h1:YtC+hqGKx9M8B6fHgA1eFlq1yjEiOWwp1zZqyFtjSbA=
108108
github.com/openstack-k8s-operators/horizon-operator/api v0.5.1-0.20241119161147-c38568cb3fb0/go.mod h1:ezxV+6xd12IRKespGaDlJCUQ301yxrBlQUCEbeYQgSA=
109-
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241118112815-d52a058b34a8 h1:mmnunGX3tnIT4ErxFjYcKb38VLjnfe9JcIcU9LaW9rE=
110-
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241118112815-d52a058b34a8/go.mod h1:6x5zgJJBjrOhsTtNALYrM2ecUH92kIoZbZ6w1fKHPfs=
109+
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241120235143-b225194fd0fd h1:6LmBamNQRwX76TiR+qo7Ejkb5bT2IPFhstkTWtVh7m4=
110+
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241120235143-b225194fd0fd/go.mod h1:6x5zgJJBjrOhsTtNALYrM2ecUH92kIoZbZ6w1fKHPfs=
111111
github.com/openstack-k8s-operators/ironic-operator/api v0.5.1-0.20241114211630-5b4dcbed9b37 h1:k++YKQetyZqG6t+kWLhVUclgwLRKspCEyxeEWCeDgjM=
112112
github.com/openstack-k8s-operators/ironic-operator/api v0.5.1-0.20241114211630-5b4dcbed9b37/go.mod h1:nKeZBXFCwbYxTpIW9mPs/SK+4cODkEZgs+yOytvafBo=
113113
github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241119162247-18b741090348 h1:mJeXL6JpNWe7d8wA8UZ1EI5T70f8HIgE2ecNjfPFIq4=

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14703,6 +14703,10 @@ spec:
1470314703
templates:
1470414704
additionalProperties:
1470514705
properties:
14706+
nodeSelector:
14707+
additionalProperties:
14708+
type: string
14709+
type: object
1470614710
replicas:
1470714711
default: 1
1470814712
format: int32

‎go.mod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ require (
1919
github.com/openstack-k8s-operators/glance-operator/api v0.5.1-0.20241120062804-89e9fe93e886
2020
github.com/openstack-k8s-operators/heat-operator/api v0.5.1-0.20241120140156-1c476cfe7c63
2121
github.com/openstack-k8s-operators/horizon-operator/api v0.5.1-0.20241119161147-c38568cb3fb0
22-
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241118112815-d52a058b34a8
22+
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241120235143-b225194fd0fd
2323
github.com/openstack-k8s-operators/ironic-operator/api v0.5.1-0.20241114211630-5b4dcbed9b37
2424
github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241119162247-18b741090348
2525
github.com/openstack-k8s-operators/lib-common/modules/ansible v0.5.0

‎go.sum‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ github.com/openstack-k8s-operators/heat-operator/api v0.5.1-0.20241120140156-1c4
112112
github.com/openstack-k8s-operators/heat-operator/api v0.5.1-0.20241120140156-1c476cfe7c63/go.mod h1:PuXjq4bV3/mYo4OAD/4tTon0N7E9YYXZHWiZLeZFVek=
113113
github.com/openstack-k8s-operators/horizon-operator/api v0.5.1-0.20241119161147-c38568cb3fb0 h1:YtC+hqGKx9M8B6fHgA1eFlq1yjEiOWwp1zZqyFtjSbA=
114114
github.com/openstack-k8s-operators/horizon-operator/api v0.5.1-0.20241119161147-c38568cb3fb0/go.mod h1:ezxV+6xd12IRKespGaDlJCUQ301yxrBlQUCEbeYQgSA=
115-
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241118112815-d52a058b34a8 h1:mmnunGX3tnIT4ErxFjYcKb38VLjnfe9JcIcU9LaW9rE=
116-
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241118112815-d52a058b34a8/go.mod h1:6x5zgJJBjrOhsTtNALYrM2ecUH92kIoZbZ6w1fKHPfs=
115+
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241120235143-b225194fd0fd h1:6LmBamNQRwX76TiR+qo7Ejkb5bT2IPFhstkTWtVh7m4=
116+
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241120235143-b225194fd0fd/go.mod h1:6x5zgJJBjrOhsTtNALYrM2ecUH92kIoZbZ6w1fKHPfs=
117117
github.com/openstack-k8s-operators/ironic-operator/api v0.5.1-0.20241114211630-5b4dcbed9b37 h1:k++YKQetyZqG6t+kWLhVUclgwLRKspCEyxeEWCeDgjM=
118118
github.com/openstack-k8s-operators/ironic-operator/api v0.5.1-0.20241114211630-5b4dcbed9b37/go.mod h1:nKeZBXFCwbYxTpIW9mPs/SK+4cODkEZgs+yOytvafBo=
119119
github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241119162247-18b741090348 h1:mJeXL6JpNWe7d8wA8UZ1EI5T70f8HIgE2ecNjfPFIq4=

‎pkg/openstack/dnsmasq.go‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@ func ReconcileDNSMasqs(ctx context.Context, instance *corev1beta1.OpenStackContr
4040
instance.Spec.DNS.Template = &networkv1.DNSMasqSpec{}
4141
}
4242

43+
if instance.Spec.DNS.Template.NodeSelector == nil {
44+
instance.Spec.DNS.Template.NodeSelector = &instance.Spec.NodeSelector
45+
}
46+
4347
Log.Info("Reconciling DNSMasq", "DNSMasq.Namespace", instance.Namespace, "DNSMasq.Name", "dnsmasq")
4448
op, err := controllerutil.CreateOrPatch(ctx, helper.GetClient(), dnsmasq, func() error {
4549
instance.Spec.DNS.Template.DeepCopyInto(&dnsmasq.Spec)
4650
dnsmasq.Spec.ContainerImage = *version.Status.ContainerImages.InfraDnsmasqImage
47-
if dnsmasq.Spec.NodeSelector == nil && instance.Spec.NodeSelector != nil {
48-
dnsmasq.Spec.NodeSelector = instance.Spec.NodeSelector
49-
}
5051
err := controllerutil.SetControllerReference(helper.GetBeforeObject(), dnsmasq, helper.GetScheme())
5152
if err != nil {
5253
return err

‎pkg/openstack/memcached.go‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ func reconcileMemcached(
199199
tlsCert = certSecret.Name
200200
}
201201

202+
if spec.NodeSelector == nil {
203+
spec.NodeSelector = &instance.Spec.NodeSelector
204+
}
205+
202206
op, err := controllerutil.CreateOrPatch(ctx, helper.GetClient(), memcached, func() error {
203207
spec.DeepCopyInto(&memcached.Spec.MemcachedSpecCore)
204208

‎pkg/openstack/redis.go‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ func reconcileRedis(
219219
tlsCert = certSecret.Name
220220
}
221221

222+
if spec.NodeSelector == nil {
223+
spec.NodeSelector = &instance.Spec.NodeSelector
224+
}
225+
222226
op, err := controllerutil.CreateOrPatch(ctx, helper.GetClient(), redis, func() error {
223227
spec.DeepCopyInto(&redis.Spec.RedisSpecCore)
224228
if tlsCert != "" {

0 commit comments

Comments
 (0)