Skip to content

Commit 1be93f7

Browse files
committed
Make rabbitmq user and vhost name shorter in kuttl tests
Some recent change (maybe [1a)], the string used in infra-operator for rabbitmquser creation has changed from `nova-kuttl-notification-transport-nova-notifications-user` to `rabbitmq-notifications-nova-notifications-user-nova-notifications` which is longer that 63 char openshift limit, leading to error: RabbitMQ user error occurred Secret "rabbitmq-user-rabbitmq-notifications-nova-notifications-user-nova-notifications" is invalid: metadata.labels: Invalid value: "rabbitmq-notifications-nova-notifications-user-nova-notifications": must be no more than 63 characters While this may be understood as a bug, this patch is making vhost and user names shorter to unblock the kuttl test. [1] openstack-k8s-operators/infra-operator@fcc8556#diff-627c3e6f14aec9dd16405a764cf2e60199490e15a399bd3df182df26f00e999d Signed-off-by: Alfredo Moralejo <amoralej@redhat.com>
1 parent 5701277 commit 1be93f7

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

test/kuttl/test-suites/default/rmquser-vhost/01-assert.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ metadata:
1414
name: nova-kuttl-notification-transport
1515
spec:
1616
rabbitmqClusterName: rabbitmq-notifications
17-
username: nova-notifications
18-
vhost: nova-notifications
17+
username: nova-notif
18+
vhost: nova-notif
1919
---
2020
# Verify that 2 TransportURL CRs were created (separate clusters)
2121
apiVersion: kuttl.dev/v1beta1
@@ -63,15 +63,15 @@ commands:
6363
# Verify notification-transport has correct user and vhost
6464
notif_user=$(kubectl get transporturl nova-kuttl-notification-transport -n $NAMESPACE -o jsonpath='{.spec.username}')
6565
notif_vhost=$(kubectl get transporturl nova-kuttl-notification-transport -n $NAMESPACE -o jsonpath='{.spec.vhost}')
66-
if [ "$notif_user" != "nova-notifications" ]; then
67-
echo "Expected notification-transport username 'nova-notifications', found '$notif_user'"
66+
if [ "$notif_user" != "nova-notif" ]; then
67+
echo "Expected notification-transport username 'nova-notif', found '$notif_user'"
6868
exit 1
6969
fi
70-
if [ "$notif_vhost" != "nova-notifications" ]; then
71-
echo "Expected notification-transport vhost 'nova-notifications', found '$notif_vhost'"
70+
if [ "$notif_vhost" != "nova-notif" ]; then
71+
echo "Expected notification-transport vhost 'nova-notif', found '$notif_vhost'"
7272
exit 1
7373
fi
74-
echo "Notification transport has correct user (nova-notifications) and vhost (nova-notifications)"
74+
echo "Notification transport has correct user (nova-notif) and vhost (nova-notif)"
7575
7676
# Verify that nova.conf contains the notifications transport_url
7777
NOVA_API_POD=$(kubectl get pods -n $NAMESPACE -l "service=nova-api" -o custom-columns=:metadata.name --no-headers | grep -v ^$ | head -1)
@@ -109,18 +109,18 @@ commands:
109109
fi
110110
echo "Found notifications transport_url: $notif_transport_url"
111111
112-
# Verify the notifications transport_url contains the correct vhost (nova-notifications)
113-
if ! echo "$notif_transport_url" | grep -q '/nova-notifications'; then
114-
echo "Notifications transport_url does not contain expected vhost '/nova-notifications'"
112+
# Verify the notifications transport_url contains the correct vhost (nova-notif)
113+
if ! echo "$notif_transport_url" | grep -q '/nova-notif'; then
114+
echo "Notifications transport_url does not contain expected vhost '/nova-notif'"
115115
exit 1
116116
fi
117-
echo "Successfully verified vhost 'nova-notifications' in notifications transport_url"
117+
echo "Successfully verified vhost 'nova-notif' in notifications transport_url"
118118
119-
# Verify the notifications transport_url contains the correct username (nova-notifications)
120-
if ! echo "$notif_transport_url" | grep -q 'nova-notifications:'; then
121-
echo "Notifications transport_url does not contain expected username 'nova-notifications:'"
119+
# Verify the notifications transport_url contains the correct username (nova-notif)
120+
if ! echo "$notif_transport_url" | grep -q 'nova-notif:'; then
121+
echo "Notifications transport_url does not contain expected username 'nova-notif:'"
122122
exit 1
123123
fi
124-
echo "Successfully verified username 'nova-notifications' in notifications transport_url"
124+
echo "Successfully verified username 'nova-notif' in notifications transport_url"
125125
126126
exit 0

test/kuttl/test-suites/default/rmquser-vhost/01-deploy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ spec:
1010
vhost: nova-rpc
1111
notificationsBus:
1212
cluster: rabbitmq-notifications
13-
user: nova-notifications
14-
vhost: nova-notifications
13+
user: nova-notif
14+
vhost: nova-notif

0 commit comments

Comments
 (0)