From da92f69c340137f6bdf11d99429587bb31362929 Mon Sep 17 00:00:00 2001 From: Chunyi Lyu Date: Tue, 11 Jan 2022 13:54:09 +0000 Subject: [PATCH] Set podSecurityContext.fsGroup to 0 instead of 999 --- internal/resource/statefulset.go | 2 +- internal/resource/statefulset_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/resource/statefulset.go b/internal/resource/statefulset.go index 2d9517c3d..2233e6499 100644 --- a/internal/resource/statefulset.go +++ b/internal/resource/statefulset.go @@ -555,7 +555,7 @@ func (builder *StatefulSetBuilder) podTemplateSpec(previousPodAnnotations map[st }, }, SecurityContext: &corev1.PodSecurityContext{ - FSGroup: &rabbitmqUID, + FSGroup: pointer.Int64(0), RunAsUser: &rabbitmqUID, }, ImagePullSecrets: builder.Instance.Spec.ImagePullSecrets, diff --git a/internal/resource/statefulset_test.go b/internal/resource/statefulset_test.go index 551e9485c..bf64f7829 100644 --- a/internal/resource/statefulset_test.go +++ b/internal/resource/statefulset_test.go @@ -1307,7 +1307,7 @@ default_pass = {{ .Data.data.password }} rmqUID := int64(999) expectedPodSecurityContext := &corev1.PodSecurityContext{ - FSGroup: &rmqUID, + FSGroup: pointer.Int64(0), RunAsUser: &rmqUID, }