Skip to content

Commit 0318c07

Browse files
This patch allows Octavia to set its route annotations.
Depends-On: openstack-k8s-operators/octavia-operator#403 Related-Issue: OSPRH-10959
1 parent df64f5b commit 0318c07

8 files changed

Lines changed: 24 additions & 6 deletions

File tree

apis/bases/core.openstack.org_openstackcontrolplanes.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9130,7 +9130,8 @@ spec:
91309130
apacheContainerImage:
91319131
type: string
91329132
apiTimeout:
9133-
type: string
9133+
default: 120
9134+
type: integer
91349135
customServiceConfig:
91359136
default: '# add your customization here'
91369137
type: string
@@ -9171,6 +9172,8 @@ spec:
91719172
type: object
91729173
octaviaAPI:
91739174
properties:
9175+
apiTimeout:
9176+
type: integer
91749177
customServiceConfig:
91759178
default: '# add your customization here'
91769179
type: string
@@ -9889,6 +9892,7 @@ spec:
98899892
type: string
98909893
required:
98919894
- apacheContainerImage
9895+
- apiTimeout
98929896
- databaseInstance
98939897
- octaviaAPI
98949898
- octaviaNetworkAttachment

apis/core/v1beta1/openstackcontrolplane_webhook.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,8 @@ func (r *OpenStackControlPlane) DefaultServices() {
896896
}
897897

898898
r.Spec.Octavia.Template.Default()
899+
initializeOverrideSpec(&r.Spec.Octavia.APIOverride.Route, true)
900+
r.Spec.Octavia.Template.SetDefaultRouteAnnotations(r.Spec.Octavia.APIOverride.Route.Annotations)
899901
}
900902

901903
// Barbican

apis/go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,5 @@ replace github.com/openshift/api => github.com/openshift/api v0.0.0-202408300231
115115

116116
// custom RabbitmqClusterSpecCore for OpenStackControlplane (v2.9.0_patches_tag)
117117
replace github.com/rabbitmq/cluster-operator/v2 => github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20241017142550-a3524acedd49 //allow-merging
118+
119+
replace github.com/openstack-k8s-operators/octavia-operator/api => github.com/fernandoroyosanchez/octavia-operator/api v0.0.0-20241107131007-1c6bb990d622

apis/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ
1414
github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
1515
github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg=
1616
github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ=
17+
github.com/fernandoroyosanchez/octavia-operator/api v0.0.0-20241107131007-1c6bb990d622 h1:Bn5/Nxwgec5Fqy9o5drUss8qqYUsZgMGhKRPbceVSmI=
18+
github.com/fernandoroyosanchez/octavia-operator/api v0.0.0-20241107131007-1c6bb990d622/go.mod h1:O8z7OV48TD59UGoOg9FgOjpuNU5brIwGwQ3ObGTIdXg=
1719
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
1820
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
1921
github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
@@ -126,8 +128,6 @@ github.com/openstack-k8s-operators/neutron-operator/api v0.5.1-0.20241106150939-
126128
github.com/openstack-k8s-operators/neutron-operator/api v0.5.1-0.20241106150939-8108068a452f/go.mod h1:LFsG8CyB7La/55IFsa/TGK+LxJ3PrfgLv77FM9xiGOY=
127129
github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241105105110-d4bfa598cee7 h1:ztIBhZAChwMSBQfzUgWE1zoPvxVcLuJQanTeS9z43yw=
128130
github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241105105110-d4bfa598cee7/go.mod h1:lfMDfS0ROyH3mGnPhfdn2zus1wbhqYDIWN2tXYnnWAQ=
129-
github.com/openstack-k8s-operators/octavia-operator/api v0.5.1-0.20241105111556-f9cd9b8eefed h1:mpi0WpWIzFVS8nWaCpN6XHMSQ6yohzXZ4f4SAUVWrlM=
130-
github.com/openstack-k8s-operators/octavia-operator/api v0.5.1-0.20241105111556-f9cd9b8eefed/go.mod h1:O8z7OV48TD59UGoOg9FgOjpuNU5brIwGwQ3ObGTIdXg=
131131
github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.5.1-0.20241030042838-d69076bd6a9d h1:CZUNDTMnekjZ6YqT7gvUF2tixo13VCOGpvKaWk0qQpM=
132132
github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.5.1-0.20241030042838-d69076bd6a9d/go.mod h1:G9nampuSFs/9i2Ldx3OasU6oehWchwYuhBu1qMWktMg=
133133
github.com/openstack-k8s-operators/ovn-operator/api v0.5.1-0.20241104080525-a1bccc740d33 h1:GDLf1LwguOnUXhHIZupxiJJeOBQTUOUo1IpUWHNI8Rs=

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9130,7 +9130,8 @@ spec:
91309130
apacheContainerImage:
91319131
type: string
91329132
apiTimeout:
9133-
type: string
9133+
default: 120
9134+
type: integer
91349135
customServiceConfig:
91359136
default: '# add your customization here'
91369137
type: string
@@ -9171,6 +9172,8 @@ spec:
91719172
type: object
91729173
octaviaAPI:
91739174
properties:
9175+
apiTimeout:
9176+
type: integer
91749177
customServiceConfig:
91759178
default: '# add your customization here'
91769179
type: string
@@ -9889,6 +9892,7 @@ spec:
98899892
type: string
98909893
required:
98919894
- apacheContainerImage
9895+
- apiTimeout
98929896
- databaseInstance
98939897
- octaviaAPI
98949898
- octaviaNetworkAttachment

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,5 @@ replace github.com/openshift/api => github.com/openshift/api v0.0.0-202408300231
126126

127127
// custom RabbitmqClusterSpecCore for OpenStackControlplane (v2.9.0_patches_tag)
128128
replace github.com/rabbitmq/cluster-operator/v2 => github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20241017142550-a3524acedd49 //allow-merging
129+
130+
replace github.com/openstack-k8s-operators/octavia-operator/api => github.com/fernandoroyosanchez/octavia-operator/api v0.0.0-20241107131007-1c6bb990d622

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ
1414
github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
1515
github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg=
1616
github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ=
17+
github.com/fernandoroyosanchez/octavia-operator/api v0.0.0-20241107131007-1c6bb990d622 h1:Bn5/Nxwgec5Fqy9o5drUss8qqYUsZgMGhKRPbceVSmI=
18+
github.com/fernandoroyosanchez/octavia-operator/api v0.0.0-20241107131007-1c6bb990d622/go.mod h1:O8z7OV48TD59UGoOg9FgOjpuNU5brIwGwQ3ObGTIdXg=
1719
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
1820
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
1921
github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
@@ -138,8 +140,6 @@ github.com/openstack-k8s-operators/neutron-operator/api v0.5.1-0.20241106150939-
138140
github.com/openstack-k8s-operators/neutron-operator/api v0.5.1-0.20241106150939-8108068a452f/go.mod h1:LFsG8CyB7La/55IFsa/TGK+LxJ3PrfgLv77FM9xiGOY=
139141
github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241105105110-d4bfa598cee7 h1:ztIBhZAChwMSBQfzUgWE1zoPvxVcLuJQanTeS9z43yw=
140142
github.com/openstack-k8s-operators/nova-operator/api v0.5.1-0.20241105105110-d4bfa598cee7/go.mod h1:lfMDfS0ROyH3mGnPhfdn2zus1wbhqYDIWN2tXYnnWAQ=
141-
github.com/openstack-k8s-operators/octavia-operator/api v0.5.1-0.20241105111556-f9cd9b8eefed h1:mpi0WpWIzFVS8nWaCpN6XHMSQ6yohzXZ4f4SAUVWrlM=
142-
github.com/openstack-k8s-operators/octavia-operator/api v0.5.1-0.20241105111556-f9cd9b8eefed/go.mod h1:O8z7OV48TD59UGoOg9FgOjpuNU5brIwGwQ3ObGTIdXg=
143143
github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.5.1-0.20241030042838-d69076bd6a9d h1:CZUNDTMnekjZ6YqT7gvUF2tixo13VCOGpvKaWk0qQpM=
144144
github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.5.1-0.20241030042838-d69076bd6a9d/go.mod h1:G9nampuSFs/9i2Ldx3OasU6oehWchwYuhBu1qMWktMg=
145145
github.com/openstack-k8s-operators/ovn-operator/api v0.5.1-0.20241104080525-a1bccc740d33 h1:GDLf1LwguOnUXhHIZupxiJJeOBQTUOUo1IpUWHNI8Rs=

tests/functional/ctlplane/openstackoperator_controller_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,10 @@ var _ = Describe("OpenStackOperator controller", func() {
583583
Expect(OSCtlplane.Spec.Manila.APIOverride.Route).Should(Not(BeNil()))
584584
Expect(OSCtlplane.Spec.Manila.APIOverride.Route.Annotations).Should(HaveKeyWithValue("haproxy.router.openshift.io/timeout", "60s"))
585585
Expect(OSCtlplane.Spec.Manila.APIOverride.Route.Annotations).Should(HaveKeyWithValue("api.manila.openstack.org/timeout", "60s"))
586+
//TODO (froyo) Enable these tests when Octavia would be enabled on FTs
587+
//Expect(OSCtlplane.Spec.Octavia.APIOverride.Route).Should(Not(BeNil()))
588+
//Expect(OSCtlplane.Spec.Octavia.APIOverride.Route.Annotations).Should(HaveKeyWithValue("haproxy.router.openshift.io/timeout", "120s"))
589+
//Expect(OSCtlplane.Spec.Octavia.APIOverride.Route.Annotations).Should(HaveKeyWithValue("api.octavia.openstack.org/timeout", "120s"))
586590
})
587591

588592
It("should create selfsigned issuer and public+internal CA and issuer", func() {

0 commit comments

Comments
 (0)