diff --git a/internal/resource/statefulset.go b/internal/resource/statefulset.go index 2553f7e88..06e0a3aec 100644 --- a/internal/resource/statefulset.go +++ b/internal/resource/statefulset.go @@ -542,14 +542,10 @@ func (builder *StatefulSetBuilder) podTemplateSpec(previousPodAnnotations map[st }, Command: []string{ "sh", "-c", "cp /tmp/erlang-cookie-secret/.erlang.cookie /var/lib/rabbitmq/.erlang.cookie " + - "&& chown 999:999 /var/lib/rabbitmq/.erlang.cookie " + "&& chmod 600 /var/lib/rabbitmq/.erlang.cookie ; " + - "cp /tmp/rabbitmq-plugins/enabled_plugins /operator/enabled_plugins " + - "&& chown 999:999 /operator/enabled_plugins ; " + - "chown 999:999 /var/lib/rabbitmq/mnesia/ ; " + + "cp /tmp/rabbitmq-plugins/enabled_plugins /operator/enabled_plugins ; " + "echo '[default]' > /var/lib/rabbitmq/.rabbitmqadmin.conf " + "&& sed -e 's/default_user/username/' -e 's/default_pass/password/' /tmp/default_user.conf >> /var/lib/rabbitmq/.rabbitmqadmin.conf " + - "&& chown 999:999 /var/lib/rabbitmq/.rabbitmqadmin.conf " + "&& chmod 600 /var/lib/rabbitmq/.rabbitmqadmin.conf", }, Resources: corev1.ResourceRequirements{ diff --git a/internal/resource/statefulset_test.go b/internal/resource/statefulset_test.go index 2d3082aef..534f44d4d 100644 --- a/internal/resource/statefulset_test.go +++ b/internal/resource/statefulset_test.go @@ -1225,14 +1225,10 @@ var _ = Describe("StatefulSet", func() { })), "Command": ConsistOf( "sh", "-c", "cp /tmp/erlang-cookie-secret/.erlang.cookie /var/lib/rabbitmq/.erlang.cookie "+ - "&& chown 999:999 /var/lib/rabbitmq/.erlang.cookie "+ "&& chmod 600 /var/lib/rabbitmq/.erlang.cookie ; "+ - "cp /tmp/rabbitmq-plugins/enabled_plugins /operator/enabled_plugins "+ - "&& chown 999:999 /operator/enabled_plugins ; "+ - "chown 999:999 /var/lib/rabbitmq/mnesia/ ; "+ + "cp /tmp/rabbitmq-plugins/enabled_plugins /operator/enabled_plugins ; "+ "echo '[default]' > /var/lib/rabbitmq/.rabbitmqadmin.conf "+ "&& sed -e 's/default_user/username/' -e 's/default_pass/password/' /tmp/default_user.conf >> /var/lib/rabbitmq/.rabbitmqadmin.conf "+ - "&& chown 999:999 /var/lib/rabbitmq/.rabbitmqadmin.conf "+ "&& chmod 600 /var/lib/rabbitmq/.rabbitmqadmin.conf", ), "VolumeMounts": ConsistOf([]corev1.VolumeMount{