Skip to content

Commit b5b99ab

Browse files
committed
Make deprecated parameter optional
1 parent fe6f484 commit b5b99ab

File tree

6 files changed

+15
-19
lines changed

6 files changed

+15
-19
lines changed

api/bases/octavia.openstack.org_octavias.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,11 +1588,10 @@ spec:
15881588
e.g. to check logs
15891589
type: boolean
15901590
rabbitMqClusterName:
1591-
default: rabbitmq
15921591
description: |-
15931592
RabbitMQ instance name
15941593
Needed to request a transportURL that is created and used in Octavia
1595-
Deprecated: use MessagingBus.Cluster instead
1594+
Deprecated: Use MessagingBus.Cluster instead
15961595
type: string
15971596
redisServiceName:
15981597
default: octavia-redis
@@ -1712,7 +1711,6 @@ spec:
17121711
- databaseInstance
17131712
- octaviaAPI
17141713
- octaviaNetworkAttachment
1715-
- rabbitMqClusterName
17161714
- secret
17171715
type: object
17181716
status:

api/v1beta1/octavia_types.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,11 @@ type OctaviaSpecBase struct {
127127
// to connect for the persistence database
128128
PersistenceDatabaseAccount string `json:"persistenceDatabaseAccount"`
129129

130-
// +kubebuilder:validation:Required
131-
// +kubebuilder:default=rabbitmq
130+
// +kubebuilder:validation:Optional
132131
// RabbitMQ instance name
133132
// Needed to request a transportURL that is created and used in Octavia
134-
// Deprecated: use MessagingBus.Cluster instead
135-
RabbitMqClusterName string `json:"rabbitMqClusterName" deprecated:"messagingBus.cluster"`
133+
// Deprecated: Use MessagingBus.Cluster instead
134+
RabbitMqClusterName string `json:"rabbitMqClusterName,omitempty"`
136135

137136
// +kubebuilder:validation:Optional
138137
// MessagingBus configuration (cluster, username, and vhost)

api/v1beta1/octavia_webhook.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package v1beta1
1919
import (
2020
"fmt"
2121

22-
rabbitmqv1 "github.com/openstack-k8s-operators/infra-operator/apis/rabbitmq/v1beta1"
2322
topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"
2423
"github.com/openstack-k8s-operators/lib-common/modules/common/service"
2524
common_webhook "github.com/openstack-k8s-operators/lib-common/modules/common/webhook"
@@ -65,10 +64,10 @@ func (r *Octavia) Default() {
6564

6665
// Default - set defaults for this Octavia spec
6766
func (spec *OctaviaSpec) Default() {
68-
// Set default RabbitMQ configuration and migrate from RabbitMqClusterName if needed
69-
// Only migrate from deprecated field if the new field is not already set
67+
// Default MessagingBus.Cluster if not set
68+
// Migration from deprecated fields is handled by openstack-operator
7069
if spec.MessagingBus.Cluster == "" {
71-
rabbitmqv1.DefaultRabbitMqConfig(&spec.MessagingBus, spec.RabbitMqClusterName)
70+
spec.MessagingBus.Cluster = "rabbitmq"
7271
}
7372

7473
if spec.OctaviaAPI.ContainerImage == "" {
@@ -99,10 +98,10 @@ func (spec *OctaviaSpec) Default() {
9998

10099
// Default - set defaults for this Octavia core spec (this version is used by the OpenStackControlplane webhook)
101100
func (spec *OctaviaSpecCore) Default() {
102-
// Set default RabbitMQ configuration and migrate from RabbitMqClusterName if needed
103-
// Only migrate from deprecated field if the new field is not already set
101+
// Default MessagingBus.Cluster if not set
102+
// Migration from deprecated fields is handled by openstack-operator
104103
if spec.MessagingBus.Cluster == "" {
105-
rabbitmqv1.DefaultRabbitMqConfig(&spec.MessagingBus, spec.RabbitMqClusterName)
104+
spec.MessagingBus.Cluster = "rabbitmq"
106105
}
107106
}
108107

config/crd/bases/octavia.openstack.org_octavias.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,11 +1588,10 @@ spec:
15881588
e.g. to check logs
15891589
type: boolean
15901590
rabbitMqClusterName:
1591-
default: rabbitmq
15921591
description: |-
15931592
RabbitMQ instance name
15941593
Needed to request a transportURL that is created and used in Octavia
1595-
Deprecated: use MessagingBus.Cluster instead
1594+
Deprecated: Use MessagingBus.Cluster instead
15961595
type: string
15971596
redisServiceName:
15981597
default: octavia-redis
@@ -1712,7 +1711,6 @@ spec:
17121711
- databaseInstance
17131712
- octaviaAPI
17141713
- octaviaNetworkAttachment
1715-
- rabbitMqClusterName
17161714
- secret
17171715
type: object
17181716
status:

test/kuttl/tests/octavia_tls/02-deploy.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ spec:
66
databaseInstance: openstack
77
databaseUser: octavia
88
serviceUser: octavia
9-
rabbitMqClusterName: rabbitmq
9+
messagingBus:
10+
cluster: rabbitmq
1011
secret: osp-secret
1112
preserveJobs: false
1213
customServiceConfig: |

test/kuttl/tests/octavia_topology/01-deploy-octavia.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ spec:
88
databaseInstance: openstack
99
databaseUser: octavia
1010
serviceUser: octavia
11-
rabbitMqClusterName: rabbitmq
11+
messagingBus:
12+
cluster: rabbitmq
1213
secret: osp-secret
1314
preserveJobs: false
1415
customServiceConfig: |

0 commit comments

Comments
 (0)