From f91c5f8f4ad7d15ab8357f4ffc316802f80f6222 Mon Sep 17 00:00:00 2001 From: Fernando Royo Date: Thu, 7 Nov 2024 11:44:30 +0100 Subject: [PATCH] This patch allows Octavia to set its route annotations. Depends-On: https://github.com/openstack-k8s-operators/octavia-operator/pull/412 Related-Issue: OSPRH-10959 --- apis/bases/core.openstack.org_openstackcontrolplanes.yaml | 6 +++++- apis/core/v1beta1/openstackcontrolplane_webhook.go | 2 ++ apis/go.mod | 4 ++-- apis/go.sum | 8 ++++---- .../bases/core.openstack.org_openstackcontrolplanes.yaml | 6 +++++- go.mod | 4 ++-- go.sum | 8 ++++---- .../ctlplane/openstackoperator_controller_test.go | 4 ++++ 8 files changed, 28 insertions(+), 14 deletions(-) diff --git a/apis/bases/core.openstack.org_openstackcontrolplanes.yaml b/apis/bases/core.openstack.org_openstackcontrolplanes.yaml index f2cfd8597..c10294eef 100644 --- a/apis/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/apis/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -9130,7 +9130,8 @@ spec: apacheContainerImage: type: string apiTimeout: - type: string + default: 120 + type: integer customServiceConfig: default: '# add your customization here' type: string @@ -9171,6 +9172,8 @@ spec: type: object octaviaAPI: properties: + apiTimeout: + type: integer customServiceConfig: default: '# add your customization here' type: string @@ -9889,6 +9892,7 @@ spec: type: string required: - apacheContainerImage + - apiTimeout - databaseInstance - octaviaAPI - octaviaNetworkAttachment diff --git a/apis/core/v1beta1/openstackcontrolplane_webhook.go b/apis/core/v1beta1/openstackcontrolplane_webhook.go index da2db86c8..b76b615de 100644 --- a/apis/core/v1beta1/openstackcontrolplane_webhook.go +++ b/apis/core/v1beta1/openstackcontrolplane_webhook.go @@ -896,6 +896,8 @@ func (r *OpenStackControlPlane) DefaultServices() { } r.Spec.Octavia.Template.Default() + initializeOverrideSpec(&r.Spec.Octavia.APIOverride.Route, true) + r.Spec.Octavia.Template.SetDefaultRouteAnnotations(r.Spec.Octavia.APIOverride.Route.Annotations) } // Barbican diff --git a/apis/go.mod b/apis/go.mod index 02e5e8bd2..fa4683cdd 100644 --- a/apis/go.mod +++ b/apis/go.mod @@ -16,13 +16,13 @@ require ( github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241106062833-6ba8f6c612c7 github.com/openstack-k8s-operators/ironic-operator/api v0.5.1-0.20241106034332-79154efb7555 github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241106094500-2e94eb1e34a5 - github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241104140916-71a0e9d9766d + github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241113144931-ff1fd2dcd04a github.com/openstack-k8s-operators/lib-common/modules/storage v0.5.1-0.20241104140916-71a0e9d9766d github.com/openstack-k8s-operators/manila-operator/api v0.5.1-0.20241106152337-61488e9159ce 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.20241106150939-8108068a452f github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241105105110-d4bfa598cee7 - github.com/openstack-k8s-operators/octavia-operator/api v0.5.1-0.20241105111556-f9cd9b8eefed + 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.20241104080525-a1bccc740d33 github.com/openstack-k8s-operators/placement-operator/api v0.5.1-0.20241105102056-1bd39d75b43b diff --git a/apis/go.sum b/apis/go.sum index 77928d4ef..d684061dc 100644 --- a/apis/go.sum +++ b/apis/go.sum @@ -112,8 +112,8 @@ github.com/openstack-k8s-operators/ironic-operator/api v0.5.1-0.20241106034332-7 github.com/openstack-k8s-operators/ironic-operator/api v0.5.1-0.20241106034332-79154efb7555/go.mod h1:G2+GeBF23/YqS1KvMtoSyfxOBMa+Gj3XaahLT5OG598= github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241106094500-2e94eb1e34a5 h1:KejIMvM/Mwb9/L3nRfCp9Zb9gZhnko3SJT4qnLEOsFI= github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241106094500-2e94eb1e34a5/go.mod h1:3ZVAfShONGUZDenwtq8CHTf3p2CxcH1fN7J7Ff/ZSiQ= -github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241104140916-71a0e9d9766d h1:4rZOEft7IFZSzPx+QVuaRq1KEfM8MT+qBILnoa3Kf00= -github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241104140916-71a0e9d9766d/go.mod h1:YpNTuJhDWhbXM50O3qBkhO7M+OOyRmWkNVmJ4y3cyFs= +github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241113144931-ff1fd2dcd04a h1:izLb1IVe6pXuQ6Y49CIAkN7yS9qe2fDptRlhxMHSYv4= +github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241113144931-ff1fd2dcd04a/go.mod h1:YpNTuJhDWhbXM50O3qBkhO7M+OOyRmWkNVmJ4y3cyFs= github.com/openstack-k8s-operators/lib-common/modules/openstack v0.5.1-0.20241104140916-71a0e9d9766d h1:Li5NFO947jH8Oe9jZVAhHYWqDaGjBBMx2n8QIIw22GI= github.com/openstack-k8s-operators/lib-common/modules/openstack v0.5.1-0.20241104140916-71a0e9d9766d/go.mod h1:IASoGvp5QM/tBJUd/8i8uIjj4DBnI+64Ydh4r7pmnvA= github.com/openstack-k8s-operators/lib-common/modules/storage v0.5.1-0.20241104140916-71a0e9d9766d h1:6fA7kvhKRelVwNWxcMVe2d2lkN8MITY0OIudTBnmT+A= @@ -126,8 +126,8 @@ github.com/openstack-k8s-operators/neutron-operator/api v0.5.1-0.20241106150939- github.com/openstack-k8s-operators/neutron-operator/api v0.5.1-0.20241106150939-8108068a452f/go.mod h1:LFsG8CyB7La/55IFsa/TGK+LxJ3PrfgLv77FM9xiGOY= github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241105105110-d4bfa598cee7 h1:ztIBhZAChwMSBQfzUgWE1zoPvxVcLuJQanTeS9z43yw= github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241105105110-d4bfa598cee7/go.mod h1:lfMDfS0ROyH3mGnPhfdn2zus1wbhqYDIWN2tXYnnWAQ= -github.com/openstack-k8s-operators/octavia-operator/api v0.5.1-0.20241105111556-f9cd9b8eefed h1:mpi0WpWIzFVS8nWaCpN6XHMSQ6yohzXZ4f4SAUVWrlM= -github.com/openstack-k8s-operators/octavia-operator/api v0.5.1-0.20241105111556-f9cd9b8eefed/go.mod h1:O8z7OV48TD59UGoOg9FgOjpuNU5brIwGwQ3ObGTIdXg= +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= github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.5.1-0.20241030042838-d69076bd6a9d/go.mod h1:G9nampuSFs/9i2Ldx3OasU6oehWchwYuhBu1qMWktMg= github.com/openstack-k8s-operators/ovn-operator/api v0.5.1-0.20241104080525-a1bccc740d33 h1:GDLf1LwguOnUXhHIZupxiJJeOBQTUOUo1IpUWHNI8Rs= diff --git a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml index f2cfd8597..c10294eef 100644 --- a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -9130,7 +9130,8 @@ spec: apacheContainerImage: type: string apiTimeout: - type: string + default: 120 + type: integer customServiceConfig: default: '# add your customization here' type: string @@ -9171,6 +9172,8 @@ spec: type: object octaviaAPI: properties: + apiTimeout: + type: integer customServiceConfig: default: '# add your customization here' type: string @@ -9889,6 +9892,7 @@ spec: type: string required: - apacheContainerImage + - apiTimeout - databaseInstance - octaviaAPI - octaviaNetworkAttachment diff --git a/go.mod b/go.mod index 5ec6a5547..02ad599b0 100644 --- a/go.mod +++ b/go.mod @@ -23,14 +23,14 @@ require ( github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241106094500-2e94eb1e34a5 github.com/openstack-k8s-operators/lib-common/modules/ansible v0.5.0 github.com/openstack-k8s-operators/lib-common/modules/certmanager v0.5.1-0.20241104140916-71a0e9d9766d - github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241104140916-71a0e9d9766d + github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241113144931-ff1fd2dcd04a github.com/openstack-k8s-operators/lib-common/modules/storage v0.5.1-0.20241104140916-71a0e9d9766d github.com/openstack-k8s-operators/lib-common/modules/test v0.5.1-0.20241104140916-71a0e9d9766d github.com/openstack-k8s-operators/manila-operator/api v0.5.1-0.20241106152337-61488e9159ce 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.20241106150939-8108068a452f github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241105105110-d4bfa598cee7 - github.com/openstack-k8s-operators/octavia-operator/api v0.5.1-0.20241105111556-f9cd9b8eefed + 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 github.com/openstack-k8s-operators/ovn-operator/api v0.5.1-0.20241104080525-a1bccc740d33 diff --git a/go.sum b/go.sum index 7dd6979a6..f590ddbb9 100644 --- a/go.sum +++ b/go.sum @@ -122,8 +122,8 @@ github.com/openstack-k8s-operators/lib-common/modules/ansible v0.5.0 h1:M6tou1UD github.com/openstack-k8s-operators/lib-common/modules/ansible v0.5.0/go.mod h1:FxA/2ChDnVKgbZAyiiRLDGZB7WMcrHlOMBZYUQGgRf0= github.com/openstack-k8s-operators/lib-common/modules/certmanager v0.5.1-0.20241104140916-71a0e9d9766d h1:Bq8vsu4SLco9kRClcXflMk9wHEagkXr58MG9u7FmaR4= github.com/openstack-k8s-operators/lib-common/modules/certmanager v0.5.1-0.20241104140916-71a0e9d9766d/go.mod h1:MdZhEe4ciAXJwWygYBMJCIVONZWv+MqBIp/0+LxFcS0= -github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241104140916-71a0e9d9766d h1:4rZOEft7IFZSzPx+QVuaRq1KEfM8MT+qBILnoa3Kf00= -github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241104140916-71a0e9d9766d/go.mod h1:YpNTuJhDWhbXM50O3qBkhO7M+OOyRmWkNVmJ4y3cyFs= +github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241113144931-ff1fd2dcd04a h1:izLb1IVe6pXuQ6Y49CIAkN7yS9qe2fDptRlhxMHSYv4= +github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241113144931-ff1fd2dcd04a/go.mod h1:YpNTuJhDWhbXM50O3qBkhO7M+OOyRmWkNVmJ4y3cyFs= github.com/openstack-k8s-operators/lib-common/modules/openstack v0.5.1-0.20241104140916-71a0e9d9766d h1:Li5NFO947jH8Oe9jZVAhHYWqDaGjBBMx2n8QIIw22GI= github.com/openstack-k8s-operators/lib-common/modules/openstack v0.5.1-0.20241104140916-71a0e9d9766d/go.mod h1:IASoGvp5QM/tBJUd/8i8uIjj4DBnI+64Ydh4r7pmnvA= github.com/openstack-k8s-operators/lib-common/modules/storage v0.5.1-0.20241104140916-71a0e9d9766d h1:6fA7kvhKRelVwNWxcMVe2d2lkN8MITY0OIudTBnmT+A= @@ -138,8 +138,8 @@ github.com/openstack-k8s-operators/neutron-operator/api v0.5.1-0.20241106150939- github.com/openstack-k8s-operators/neutron-operator/api v0.5.1-0.20241106150939-8108068a452f/go.mod h1:LFsG8CyB7La/55IFsa/TGK+LxJ3PrfgLv77FM9xiGOY= github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241105105110-d4bfa598cee7 h1:ztIBhZAChwMSBQfzUgWE1zoPvxVcLuJQanTeS9z43yw= github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241105105110-d4bfa598cee7/go.mod h1:lfMDfS0ROyH3mGnPhfdn2zus1wbhqYDIWN2tXYnnWAQ= -github.com/openstack-k8s-operators/octavia-operator/api v0.5.1-0.20241105111556-f9cd9b8eefed h1:mpi0WpWIzFVS8nWaCpN6XHMSQ6yohzXZ4f4SAUVWrlM= -github.com/openstack-k8s-operators/octavia-operator/api v0.5.1-0.20241105111556-f9cd9b8eefed/go.mod h1:O8z7OV48TD59UGoOg9FgOjpuNU5brIwGwQ3ObGTIdXg= +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= github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.5.1-0.20241030042838-d69076bd6a9d/go.mod h1:G9nampuSFs/9i2Ldx3OasU6oehWchwYuhBu1qMWktMg= github.com/openstack-k8s-operators/ovn-operator/api v0.5.1-0.20241104080525-a1bccc740d33 h1:GDLf1LwguOnUXhHIZupxiJJeOBQTUOUo1IpUWHNI8Rs= diff --git a/tests/functional/ctlplane/openstackoperator_controller_test.go b/tests/functional/ctlplane/openstackoperator_controller_test.go index ddcf8853e..2c58391ef 100644 --- a/tests/functional/ctlplane/openstackoperator_controller_test.go +++ b/tests/functional/ctlplane/openstackoperator_controller_test.go @@ -583,6 +583,10 @@ var _ = Describe("OpenStackOperator controller", func() { Expect(OSCtlplane.Spec.Manila.APIOverride.Route).Should(Not(BeNil())) Expect(OSCtlplane.Spec.Manila.APIOverride.Route.Annotations).Should(HaveKeyWithValue("haproxy.router.openshift.io/timeout", "60s")) Expect(OSCtlplane.Spec.Manila.APIOverride.Route.Annotations).Should(HaveKeyWithValue("api.manila.openstack.org/timeout", "60s")) + //TODO (froyo) Enable these tests when Octavia would be enabled on FTs + //Expect(OSCtlplane.Spec.Octavia.APIOverride.Route).Should(Not(BeNil())) + //Expect(OSCtlplane.Spec.Octavia.APIOverride.Route.Annotations).Should(HaveKeyWithValue("haproxy.router.openshift.io/timeout", "120s")) + //Expect(OSCtlplane.Spec.Octavia.APIOverride.Route.Annotations).Should(HaveKeyWithValue("api.octavia.openstack.org/timeout", "120s")) }) It("should create selfsigned issuer and public+internal CA and issuer", func() {