Skip to content

Commit 3512c6f

Browse files
authored
Remove chmod operations from init Container (#739)
This is no longer needed as fsGroup modifies this for us.
1 parent 2589675 commit 3512c6f

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

internal/resource/statefulset.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -542,14 +542,10 @@ func (builder *StatefulSetBuilder) podTemplateSpec(previousPodAnnotations map[st
542542
},
543543
Command: []string{
544544
"sh", "-c", "cp /tmp/erlang-cookie-secret/.erlang.cookie /var/lib/rabbitmq/.erlang.cookie " +
545-
"&& chown 999:999 /var/lib/rabbitmq/.erlang.cookie " +
546545
"&& chmod 600 /var/lib/rabbitmq/.erlang.cookie ; " +
547-
"cp /tmp/rabbitmq-plugins/enabled_plugins /operator/enabled_plugins " +
548-
"&& chown 999:999 /operator/enabled_plugins ; " +
549-
"chown 999:999 /var/lib/rabbitmq/mnesia/ ; " +
546+
"cp /tmp/rabbitmq-plugins/enabled_plugins /operator/enabled_plugins ; " +
550547
"echo '[default]' > /var/lib/rabbitmq/.rabbitmqadmin.conf " +
551548
"&& sed -e 's/default_user/username/' -e 's/default_pass/password/' /tmp/default_user.conf >> /var/lib/rabbitmq/.rabbitmqadmin.conf " +
552-
"&& chown 999:999 /var/lib/rabbitmq/.rabbitmqadmin.conf " +
553549
"&& chmod 600 /var/lib/rabbitmq/.rabbitmqadmin.conf",
554550
},
555551
Resources: corev1.ResourceRequirements{

internal/resource/statefulset_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,14 +1225,10 @@ var _ = Describe("StatefulSet", func() {
12251225
})),
12261226
"Command": ConsistOf(
12271227
"sh", "-c", "cp /tmp/erlang-cookie-secret/.erlang.cookie /var/lib/rabbitmq/.erlang.cookie "+
1228-
"&& chown 999:999 /var/lib/rabbitmq/.erlang.cookie "+
12291228
"&& chmod 600 /var/lib/rabbitmq/.erlang.cookie ; "+
1230-
"cp /tmp/rabbitmq-plugins/enabled_plugins /operator/enabled_plugins "+
1231-
"&& chown 999:999 /operator/enabled_plugins ; "+
1232-
"chown 999:999 /var/lib/rabbitmq/mnesia/ ; "+
1229+
"cp /tmp/rabbitmq-plugins/enabled_plugins /operator/enabled_plugins ; "+
12331230
"echo '[default]' > /var/lib/rabbitmq/.rabbitmqadmin.conf "+
12341231
"&& sed -e 's/default_user/username/' -e 's/default_pass/password/' /tmp/default_user.conf >> /var/lib/rabbitmq/.rabbitmqadmin.conf "+
1235-
"&& chown 999:999 /var/lib/rabbitmq/.rabbitmqadmin.conf "+
12361232
"&& chmod 600 /var/lib/rabbitmq/.rabbitmqadmin.conf",
12371233
),
12381234
"VolumeMounts": ConsistOf([]corev1.VolumeMount{

0 commit comments

Comments
 (0)