Skip to content

Commit d2d1763

Browse files
committed
Simplify CLI command to enable feature flags
Since we bumped the minimum supported RabbitMQ version to v3.9.0 in #1110, we can use the CLI command `rabbitmqctl enable_feature_flag all` introduced in rabbitmq/rabbitmq-server@ce65586.
1 parent 253ba87 commit d2d1763

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

controllers/reconcile_cli.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func (r *RabbitmqClusterReconciler) runRabbitmqCLICommandsIfAnnotated(ctx contex
6868
func (r *RabbitmqClusterReconciler) runEnableFeatureFlagsCommand(ctx context.Context, rmq *rabbitmqv1beta1.RabbitmqCluster, sts *appsv1.StatefulSet) error {
6969
logger := ctrl.LoggerFrom(ctx)
7070
podName := fmt.Sprintf("%s-0", rmq.ChildResourceName("server"))
71-
cmd := "set -eo pipefail; rabbitmqctl -s list_feature_flags name state stability | (grep 'disabled\\sstable$' || true) | cut -f 1 | xargs -r -n1 rabbitmqctl enable_feature_flag"
71+
cmd := "rabbitmqctl enable_feature_flag all"
7272
stdout, stderr, err := r.exec(rmq.Namespace, podName, "rabbitmq", "bash", "-c", cmd)
7373
if err != nil {
7474
msg := "failed to enable all feature flags on pod"

controllers/reconcile_cli_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ var _ = Describe("Reconcile CLI", func() {
6060
return sts.ObjectMeta.Annotations
6161
}, 5).ShouldNot(HaveKey("rabbitmq.com/createdAt"))
6262
Expect(fakeExecutor.ExecutedCommands()).To(ContainElement(command{"bash", "-c",
63-
"set -eo pipefail; rabbitmqctl -s list_feature_flags name state stability | (grep 'disabled\\sstable$' || true) | cut -f 1 | xargs -r -n1 rabbitmqctl enable_feature_flag"}))
63+
"rabbitmqctl enable_feature_flag all"}))
6464
})
6565
})
6666
})

0 commit comments

Comments
 (0)