Skip to content

Commit

Permalink
Simplify CLI command to enable feature flags
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ansd committed Aug 15, 2022
1 parent 253ba87 commit 51ff52b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion controllers/reconcile_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (r *RabbitmqClusterReconciler) runRabbitmqCLICommandsIfAnnotated(ctx contex
func (r *RabbitmqClusterReconciler) runEnableFeatureFlagsCommand(ctx context.Context, rmq *rabbitmqv1beta1.RabbitmqCluster, sts *appsv1.StatefulSet) error {
logger := ctrl.LoggerFrom(ctx)
podName := fmt.Sprintf("%s-0", rmq.ChildResourceName("server"))
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"
cmd := "rabbitmqctl enable_feature_flag all"
stdout, stderr, err := r.exec(rmq.Namespace, podName, "rabbitmq", "bash", "-c", cmd)
if err != nil {
msg := "failed to enable all feature flags on pod"
Expand Down
2 changes: 1 addition & 1 deletion controllers/reconcile_cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var _ = Describe("Reconcile CLI", func() {
return sts.ObjectMeta.Annotations
}, 5).ShouldNot(HaveKey("rabbitmq.com/createdAt"))
Expect(fakeExecutor.ExecutedCommands()).To(ContainElement(command{"bash", "-c",
"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"}))
"rabbitmqctl enable_feature_flag all"}))
})
})
})
Expand Down

0 comments on commit 51ff52b

Please sign in to comment.