diff --git a/apis/core/v1beta1/openstackcontrolplane_webhook.go b/apis/core/v1beta1/openstackcontrolplane_webhook.go index 0c07a6163..7985e6874 100644 --- a/apis/core/v1beta1/openstackcontrolplane_webhook.go +++ b/apis/core/v1beta1/openstackcontrolplane_webhook.go @@ -19,6 +19,7 @@ package v1beta1 import ( "fmt" + "github.com/openstack-k8s-operators/lib-common/modules/common/route" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" @@ -318,6 +319,14 @@ func (r *OpenStackControlPlane) Default() { r.DefaultServices() } +// Helper function to initialize overrideSpec object. Could be moved to lib-common. +func initializeOverrideSpec(override **route.OverrideSpec, anno map[string]string) { + if *override == nil { + *override = &route.OverrideSpec{} + } + (*override).AddAnnotation(anno) +} + // DefaultServices - common function for calling individual services' defaulting functions func (r *OpenStackControlPlane) DefaultServices() { // RabbitMQ @@ -381,6 +390,7 @@ func (r *OpenStackControlPlane) DefaultServices() { // Neutron r.Spec.Neutron.Template.Default() + initializeOverrideSpec(&r.Spec.Neutron.APIOverride.Route, r.Spec.Neutron.Template.GetDefaultRouteAnnotations()) // Nova r.Spec.Nova.Template.Default() diff --git a/apis/go.mod b/apis/go.mod index 77e4911c3..14c43625a 100644 --- a/apis/go.mod +++ b/apis/go.mod @@ -3,7 +3,7 @@ module github.com/openstack-k8s-operators/openstack-operator/apis go 1.20 require ( - github.com/onsi/ginkgo/v2 v2.16.0 + github.com/onsi/ginkgo/v2 v2.17.1 github.com/onsi/gomega v1.32.0 github.com/openstack-k8s-operators/barbican-operator/api v0.0.0-20240310115941-5124bc86e50e github.com/openstack-k8s-operators/cinder-operator/api v0.3.1-0.20240315185259-92a4d93fc876 @@ -18,7 +18,7 @@ require ( github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20240314165949-fec16b14c33b github.com/openstack-k8s-operators/manila-operator/api v0.3.1-0.20240315120315-d76653575db5 github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20240314113200-40cf3e6aa38e - github.com/openstack-k8s-operators/neutron-operator/api v0.3.1-0.20240308065128-4ba88761f83f + github.com/openstack-k8s-operators/neutron-operator/api v0.3.1-0.20240328201705-3f89f274c32f github.com/openstack-k8s-operators/nova-operator/api v0.3.1-0.20240313153742-4685453be3fb github.com/openstack-k8s-operators/octavia-operator/api v0.3.1-0.20240326115129-7fd1a4fa51c3 github.com/openstack-k8s-operators/ovn-operator/api v0.3.1-0.20240318052728-f132fab5c943 diff --git a/apis/go.sum b/apis/go.sum index 2962fcc11..16a5dd08c 100644 --- a/apis/go.sum +++ b/apis/go.sum @@ -69,6 +69,7 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/onsi/ginkgo/v2 v2.16.0 h1:7q1w9frJDzninhXxjZd+Y/x54XNjG/UlRLIYPZafsPM= github.com/onsi/ginkgo/v2 v2.16.0/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= +github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg= github.com/openshift/api v0.0.0-20230414143018-3367bc7e6ac7 h1:rncLxJBpFGqBztyxCMwNRnMjhhIDOWHJowi6q8G6koI= @@ -101,8 +102,12 @@ github.com/openstack-k8s-operators/manila-operator/api v0.3.1-0.20240315120315-d github.com/openstack-k8s-operators/manila-operator/api v0.3.1-0.20240315120315-d76653575db5/go.mod h1:802RCwt0cea6338iJUgrsEQ0+obtvVAdvDquIASJKEQ= github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20240314113200-40cf3e6aa38e h1:HUJV2Rd0NQZAXwV0UNdHKjO7fY5QLlDuLdI9f/OIc0Y= github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20240314113200-40cf3e6aa38e/go.mod h1:f9IIyWeoskWoeWaDFF3qmAJ2Kqyovfi0Ar/QUfk3qag= +github.com/openstack-k8s-operators/neutron-operator/api v0.3.0 h1:QLcbVW93dai51o/P5w28+UMIF96+ullprZg9KMIc8J8= +github.com/openstack-k8s-operators/neutron-operator/api v0.3.0/go.mod h1:UV+KJ1V/b+FQr5Nq1Ga3BDxJcfAT6nyirrCRnzcY+ME= github.com/openstack-k8s-operators/neutron-operator/api v0.3.1-0.20240308065128-4ba88761f83f h1:/a/+8/2zx+GAr5urESTrxac71BDjeG6vYNEScUyytFg= github.com/openstack-k8s-operators/neutron-operator/api v0.3.1-0.20240308065128-4ba88761f83f/go.mod h1:gOepjTKpq6rF0Lf69edviPOjFpjw4LHan/tWC4LB4Fs= +github.com/openstack-k8s-operators/neutron-operator/api v0.3.1-0.20240328201705-3f89f274c32f h1:uTyho5XjL/nmdEh3aRZ/ByGzrXCtYTpwsb+TaKS9UyI= +github.com/openstack-k8s-operators/neutron-operator/api v0.3.1-0.20240328201705-3f89f274c32f/go.mod h1:3noVvcFj00ClDf7LLmf+kpdAMGaS3tCHhntFXGX2qA0= github.com/openstack-k8s-operators/nova-operator/api v0.3.1-0.20240313153742-4685453be3fb h1:WwiFdrd3Qk7AsXQWMIysL8LW4XHC9gJhJ4LmbIYi4HI= github.com/openstack-k8s-operators/nova-operator/api v0.3.1-0.20240313153742-4685453be3fb/go.mod h1:s9ZDTDlY5f7cu/ZT35kGYvLD8v6mto6MOLPcsK73e54= github.com/openstack-k8s-operators/octavia-operator/api v0.3.1-0.20240326115129-7fd1a4fa51c3 h1:eBwnx+PrS4SBQxYLlByJFX7poKigiBJsv/CGoEFGIaI= diff --git a/go.mod b/go.mod index 89c206e25..3e690bead 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/go-logr/logr v1.4.1 github.com/google/uuid v1.6.0 github.com/imdario/mergo v0.3.16 - github.com/onsi/ginkgo/v2 v2.16.0 + github.com/onsi/ginkgo/v2 v2.17.1 github.com/onsi/gomega v1.32.0 github.com/openshift/api v3.9.0+incompatible github.com/openstack-k8s-operators/barbican-operator/api v0.0.0-20240310115941-5124bc86e50e @@ -27,12 +27,11 @@ require ( github.com/openstack-k8s-operators/lib-common/modules/test v0.3.1-0.20240314165949-fec16b14c33b github.com/openstack-k8s-operators/manila-operator/api v0.3.1-0.20240315120315-d76653575db5 github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20240314113200-40cf3e6aa38e - github.com/openstack-k8s-operators/neutron-operator/api v0.3.1-0.20240308065128-4ba88761f83f + github.com/openstack-k8s-operators/neutron-operator/api v0.3.1-0.20240328201705-3f89f274c32f github.com/openstack-k8s-operators/nova-operator/api v0.3.1-0.20240313153742-4685453be3fb github.com/openstack-k8s-operators/octavia-operator/api v0.3.1-0.20240326115129-7fd1a4fa51c3 github.com/openstack-k8s-operators/openstack-ansibleee-operator/api v0.3.1-0.20240313103756-fb4ac5373b65 github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.3.1-0.20240318132611-4df20882649d - github.com/openstack-k8s-operators/openstack-operator/apis v0.0.0-00010101000000-000000000000 github.com/openstack-k8s-operators/ovn-operator/api v0.3.1-0.20240318052728-f132fab5c943 github.com/openstack-k8s-operators/placement-operator/api v0.3.1-0.20240313145348-1dd69c7bc338 github.com/openstack-k8s-operators/swift-operator/api v0.3.1-0.20240315154317-8b38ff1e6a8d diff --git a/go.sum b/go.sum index 180f35d9d..b2dde3706 100644 --- a/go.sum +++ b/go.sum @@ -92,6 +92,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/onsi/ginkgo/v2 v2.16.0 h1:7q1w9frJDzninhXxjZd+Y/x54XNjG/UlRLIYPZafsPM= github.com/onsi/ginkgo/v2 v2.16.0/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= +github.com/onsi/ginkgo/v2 v2.17.1 h1:V++EzdbhI4ZV4ev0UTIj0PzhzOcReJFyJaLjtSF55M8= +github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg= github.com/openshift/api v0.0.0-20230414143018-3367bc7e6ac7 h1:rncLxJBpFGqBztyxCMwNRnMjhhIDOWHJowi6q8G6koI= @@ -130,8 +132,12 @@ github.com/openstack-k8s-operators/manila-operator/api v0.3.1-0.20240315120315-d github.com/openstack-k8s-operators/manila-operator/api v0.3.1-0.20240315120315-d76653575db5/go.mod h1:802RCwt0cea6338iJUgrsEQ0+obtvVAdvDquIASJKEQ= github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20240314113200-40cf3e6aa38e h1:HUJV2Rd0NQZAXwV0UNdHKjO7fY5QLlDuLdI9f/OIc0Y= github.com/openstack-k8s-operators/mariadb-operator/api v0.3.1-0.20240314113200-40cf3e6aa38e/go.mod h1:f9IIyWeoskWoeWaDFF3qmAJ2Kqyovfi0Ar/QUfk3qag= +github.com/openstack-k8s-operators/neutron-operator/api v0.3.0 h1:QLcbVW93dai51o/P5w28+UMIF96+ullprZg9KMIc8J8= +github.com/openstack-k8s-operators/neutron-operator/api v0.3.0/go.mod h1:UV+KJ1V/b+FQr5Nq1Ga3BDxJcfAT6nyirrCRnzcY+ME= github.com/openstack-k8s-operators/neutron-operator/api v0.3.1-0.20240308065128-4ba88761f83f h1:/a/+8/2zx+GAr5urESTrxac71BDjeG6vYNEScUyytFg= github.com/openstack-k8s-operators/neutron-operator/api v0.3.1-0.20240308065128-4ba88761f83f/go.mod h1:gOepjTKpq6rF0Lf69edviPOjFpjw4LHan/tWC4LB4Fs= +github.com/openstack-k8s-operators/neutron-operator/api v0.3.1-0.20240328201705-3f89f274c32f h1:uTyho5XjL/nmdEh3aRZ/ByGzrXCtYTpwsb+TaKS9UyI= +github.com/openstack-k8s-operators/neutron-operator/api v0.3.1-0.20240328201705-3f89f274c32f/go.mod h1:3noVvcFj00ClDf7LLmf+kpdAMGaS3tCHhntFXGX2qA0= github.com/openstack-k8s-operators/nova-operator/api v0.3.1-0.20240313153742-4685453be3fb h1:WwiFdrd3Qk7AsXQWMIysL8LW4XHC9gJhJ4LmbIYi4HI= github.com/openstack-k8s-operators/nova-operator/api v0.3.1-0.20240313153742-4685453be3fb/go.mod h1:s9ZDTDlY5f7cu/ZT35kGYvLD8v6mto6MOLPcsK73e54= github.com/openstack-k8s-operators/octavia-operator/api v0.3.1-0.20240326115129-7fd1a4fa51c3 h1:eBwnx+PrS4SBQxYLlByJFX7poKigiBJsv/CGoEFGIaI= diff --git a/tests/functional/openstackoperator_controller_test.go b/tests/functional/openstackoperator_controller_test.go index ad5d78cf8..c9e8ff934 100644 --- a/tests/functional/openstackoperator_controller_test.go +++ b/tests/functional/openstackoperator_controller_test.go @@ -96,6 +96,11 @@ var _ = Describe("OpenStackOperator controller", func() { g.Expect(keystoneAPI).Should(Not(BeNil())) }, timeout, interval).Should(Succeed()) }) + // Default route timeouts are set + It("should have default timeout for the routes set", func() { + OSCtlplane := GetOpenStackControlPlane(names.OpenStackControlplaneName) + Expect(OSCtlplane.Spec.Neutron.APIOverride.Route.Annotations).Should(HaveKeyWithValue("haproxy.router.openshift.io/timeout", "120s")) + }) It("should create selfsigned issuer and public+internal CA and issuer", func() { OSCtlplane := GetOpenStackControlPlane(names.OpenStackControlplaneName)