Skip to content

Commit

Permalink
SecurityContextConstraints: avoid unnecessary mutation of supplementa…
Browse files Browse the repository at this point in the history
…l groups.
  • Loading branch information
php-coder committed Dec 18, 2017
1 parent 2e79df0 commit 1b41ef7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/security/securitycontextconstraints/group/runasany.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func NewRunAsAny() (GroupSecurityContextConstraintsStrategy, error) {

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

// Generate a single value to be applied. This is used for FSGroup. This strategy returns nil.
Expand Down
2 changes: 1 addition & 1 deletion pkg/security/securitycontextconstraints/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (s *simpleProvider) CreatePodSecurityContext(pod *api.Pod) (*api.PodSecurit
}
}

if len(sc.SupplementalGroups) == 0 {
if sc.SupplementalGroups == nil {
supGroups, err := s.supplementalGroupStrategy.Generate(pod)
if err != nil {
return nil, nil, err
Expand Down

0 comments on commit 1b41ef7

Please sign in to comment.