From 585a949825ec49c321b0f572aa97d13fbd133b9b Mon Sep 17 00:00:00 2001 From: Oliver Walsh Date: Fri, 15 Nov 2024 17:12:18 +0000 Subject: [PATCH] Inherit top-level nodeSelector in nova template --- apis/go.mod | 2 +- apis/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- pkg/openstack/nova.go | 4 ++++ 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/apis/go.mod b/apis/go.mod index 6186ecc23..3faac7999 100644 --- a/apis/go.mod +++ b/apis/go.mod @@ -21,7 +21,7 @@ require ( github.com/openstack-k8s-operators/manila-operator/api v0.5.1-0.20241114094620-1f5a15bf6a50 github.com/openstack-k8s-operators/mariadb-operator/api v0.5.1-0.20241106141725-340c4d78fef0 github.com/openstack-k8s-operators/neutron-operator/api v0.5.1-0.20241114104932-eae3f8cd032b - github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241114101059-b95e93394d87 + github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241119125634-42b7b8417b48 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.20241030042838-d69076bd6a9d github.com/openstack-k8s-operators/ovn-operator/api v0.5.1-0.20241114004031-c25a6e443b25 diff --git a/apis/go.sum b/apis/go.sum index 045902d40..aa1c7ca4b 100644 --- a/apis/go.sum +++ b/apis/go.sum @@ -124,8 +124,8 @@ github.com/openstack-k8s-operators/mariadb-operator/api v0.5.1-0.20241106141725- github.com/openstack-k8s-operators/mariadb-operator/api v0.5.1-0.20241106141725-340c4d78fef0/go.mod h1:348EPtAdpE2LxHAH4bHdCMNP7HyX6DevwEsF9DQ0S2k= github.com/openstack-k8s-operators/neutron-operator/api v0.5.1-0.20241114104932-eae3f8cd032b h1:JMMPYDierS4YZdG9O/50kLihPQqmDz7p72btLy7Ibew= github.com/openstack-k8s-operators/neutron-operator/api v0.5.1-0.20241114104932-eae3f8cd032b/go.mod h1:Kfuu3g4PSFpEowdWhbnTgSlDpsBGswQf/WU/kKQKK7s= -github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241114101059-b95e93394d87 h1:vbozzPzNz4gEzviNq8D8yNdN09XTBKX7gzTcD4ayasI= -github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241114101059-b95e93394d87/go.mod h1:330SfEZuqG3b90HopY+Hk90y0OTyPcBa0GRKPUD7BHE= +github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241119125634-42b7b8417b48 h1:eCvn/lCMqWTvlN74nFr7nG2EvZdvJPdSR9Ts2eTaM6c= +github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241119125634-42b7b8417b48/go.mod h1:330SfEZuqG3b90HopY+Hk90y0OTyPcBa0GRKPUD7BHE= github.com/openstack-k8s-operators/octavia-operator/api v0.5.1-0.20241115111947-2336829c2d73 h1:HWHbtCBbTv3zvluSpV4ZG8Ov0VJxUn5uJOrH8orSnQs= github.com/openstack-k8s-operators/octavia-operator/api v0.5.1-0.20241115111947-2336829c2d73/go.mod h1:3bFE3g3OCC2vtwhxDKdjV7sezTj4yFeqP0C40Z5NOEA= github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.5.1-0.20241030042838-d69076bd6a9d h1:CZUNDTMnekjZ6YqT7gvUF2tixo13VCOGpvKaWk0qQpM= diff --git a/go.mod b/go.mod index 9c1a215d0..d29c36fb0 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( github.com/openstack-k8s-operators/manila-operator/api v0.5.1-0.20241114094620-1f5a15bf6a50 github.com/openstack-k8s-operators/mariadb-operator/api v0.5.1-0.20241106141725-340c4d78fef0 github.com/openstack-k8s-operators/neutron-operator/api v0.5.1-0.20241114104932-eae3f8cd032b - github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241114101059-b95e93394d87 + github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241119125634-42b7b8417b48 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.20241030042838-d69076bd6a9d github.com/openstack-k8s-operators/openstack-operator/apis v0.0.0-20240531084739-3b4c0451297c diff --git a/go.sum b/go.sum index b5560b502..47306679b 100644 --- a/go.sum +++ b/go.sum @@ -136,8 +136,8 @@ github.com/openstack-k8s-operators/mariadb-operator/api v0.5.1-0.20241106141725- github.com/openstack-k8s-operators/mariadb-operator/api v0.5.1-0.20241106141725-340c4d78fef0/go.mod h1:348EPtAdpE2LxHAH4bHdCMNP7HyX6DevwEsF9DQ0S2k= github.com/openstack-k8s-operators/neutron-operator/api v0.5.1-0.20241114104932-eae3f8cd032b h1:JMMPYDierS4YZdG9O/50kLihPQqmDz7p72btLy7Ibew= github.com/openstack-k8s-operators/neutron-operator/api v0.5.1-0.20241114104932-eae3f8cd032b/go.mod h1:Kfuu3g4PSFpEowdWhbnTgSlDpsBGswQf/WU/kKQKK7s= -github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241114101059-b95e93394d87 h1:vbozzPzNz4gEzviNq8D8yNdN09XTBKX7gzTcD4ayasI= -github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241114101059-b95e93394d87/go.mod h1:330SfEZuqG3b90HopY+Hk90y0OTyPcBa0GRKPUD7BHE= +github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241119125634-42b7b8417b48 h1:eCvn/lCMqWTvlN74nFr7nG2EvZdvJPdSR9Ts2eTaM6c= +github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241119125634-42b7b8417b48/go.mod h1:330SfEZuqG3b90HopY+Hk90y0OTyPcBa0GRKPUD7BHE= github.com/openstack-k8s-operators/octavia-operator/api v0.5.1-0.20241115111947-2336829c2d73 h1:HWHbtCBbTv3zvluSpV4ZG8Ov0VJxUn5uJOrH8orSnQs= github.com/openstack-k8s-operators/octavia-operator/api v0.5.1-0.20241115111947-2336829c2d73/go.mod h1:3bFE3g3OCC2vtwhxDKdjV7sezTj4yFeqP0C40Z5NOEA= github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.5.1-0.20241030042838-d69076bd6a9d h1:CZUNDTMnekjZ6YqT7gvUF2tixo13VCOGpvKaWk0qQpM= diff --git a/pkg/openstack/nova.go b/pkg/openstack/nova.go index 7f147ed42..7c738d37a 100644 --- a/pkg/openstack/nova.go +++ b/pkg/openstack/nova.go @@ -67,6 +67,10 @@ func ReconcileNova(ctx context.Context, instance *corev1beta1.OpenStackControlPl instance.Spec.Nova.Template = &novav1.NovaSpec{} } + if instance.Spec.Nova.Template.NodeSelector == nil { + instance.Spec.Nova.Template.NodeSelector = &instance.Spec.NodeSelector + } + // When component services got created check if there is the need to create routes and certificates if err := helper.GetClient().Get(ctx, types.NamespacedName{Name: "nova", Namespace: instance.Namespace}, nova); err != nil { if !k8s_errors.IsNotFound(err) {