Skip to content

Commit 1b41ef7

Browse files
committedDec 18, 2017
SecurityContextConstraints: avoid unnecessary mutation of supplemental groups.
1 parent 2e79df0 commit 1b41ef7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎pkg/security/securitycontextconstraints/group/runasany.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func NewRunAsAny() (GroupSecurityContextConstraintsStrategy, error) {
1818

1919
// Generate creates the group based on policy rules. This strategy returns an empty slice.
2020
func (s *runAsAny) Generate(pod *api.Pod) ([]int64, error) {
21-
return []int64{}, nil
21+
return nil, nil
2222
}
2323

2424
// Generate a single value to be applied. This is used for FSGroup. This strategy returns nil.

‎pkg/security/securitycontextconstraints/provider.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func (s *simpleProvider) CreatePodSecurityContext(pod *api.Pod) (*api.PodSecurit
124124
}
125125
}
126126

127-
if len(sc.SupplementalGroups) == 0 {
127+
if sc.SupplementalGroups == nil {
128128
supGroups, err := s.supplementalGroupStrategy.Generate(pod)
129129
if err != nil {
130130
return nil, nil, err

0 commit comments

Comments
 (0)
Please sign in to comment.