Skip to content

Commit

Permalink
Run cinder-backup and volume as cinder user
Browse files Browse the repository at this point in the history
These services do not need to run as the root
user, run them as the cinder user instead.
  • Loading branch information
eharney committed Nov 25, 2024
1 parent 5c82e9d commit f6aa4d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions pkg/cinderbackup/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ func StatefulSet(
annotations map[string]string,
) *appsv1.StatefulSet {
trueVar := true
rootUser := int64(0)
cinderUser := int64(cinderv1.CinderUserID)
cinderGroup := int64(cinderv1.CinderGroupID)

Expand Down Expand Up @@ -126,7 +125,7 @@ func StatefulSet(
Args: args,
Image: instance.Spec.ContainerImage,
SecurityContext: &corev1.SecurityContext{
RunAsUser: &rootUser,
RunAsUser: &cinderUser,
Privileged: &trueVar,
},
Env: env.MergeEnvs([]corev1.EnvVar{}, envVars),
Expand Down
3 changes: 1 addition & 2 deletions pkg/cindervolume/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ func StatefulSet(
usesLVM bool,
) *appsv1.StatefulSet {
trueVar := true
rootUser := int64(0)
cinderUser := int64(cinderv1.CinderUserID)
cinderGroup := int64(cinderv1.CinderGroupID)

Expand Down Expand Up @@ -133,7 +132,7 @@ func StatefulSet(
Args: args,
Image: instance.Spec.ContainerImage,
SecurityContext: &corev1.SecurityContext{
RunAsUser: &rootUser,
RunAsUser: &cinderUser,
Privileged: &trueVar,
},
Env: env.MergeEnvs([]corev1.EnvVar{}, envVars),
Expand Down

0 comments on commit f6aa4d5

Please sign in to comment.