Skip to content

Commit

Permalink
add security context to driver pods
Browse files Browse the repository at this point in the history
  • Loading branch information
oriyarde committed Dec 3, 2020
1 parent 4a13e37 commit 07dabe4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/controller/ibmblockcsi/syncer/csi_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ func (s *csiControllerSyncer) ensurePodSpec() corev1.PodSpec {
Containers: s.ensureContainersSpec(),
Volumes: s.ensureVolumes(),
SecurityContext: &corev1.PodSecurityContext{
FSGroup: &fsGroup,
RunAsUser: &fsGroup,
RunAsUser: &fsGroup,
RunAsNonRoot: boolptr.True(),
FSGroup: &fsGroup,
},
Affinity: s.driver.Spec.Controller.Affinity,
Tolerations: s.driver.Spec.Controller.Tolerations,
Expand Down
1 change: 1 addition & 0 deletions pkg/controller/ibmblockcsi/syncer/csi_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func (s *csiNodeSyncer) ensurePodSpec() corev1.PodSpec {
HostIPC: true,
HostNetwork: true,
ServiceAccountName: config.GetNameForResource(config.CSINodeServiceAccount, s.driver.Name),
SecurityContext: &corev1.PodSecurityContext{RunAsNonRoot: boolptr.True()},
Affinity: s.driver.Spec.Node.Affinity,
Tolerations: s.driver.Spec.Node.Tolerations,
}
Expand Down

0 comments on commit 07dabe4

Please sign in to comment.