Skip to content

Commit 2ce4955

Browse files
authored
Fix panic with missing liveness probe container security context (#65)
* Fix panic with missing liveness probe container security context * Add comment Signed-off-by: Mayank Sachan <[email protected]> --------- Signed-off-by: Mayank Sachan <[email protected]>
1 parent 761680c commit 2ce4955

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

controllers/syncer/csi_node.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ func (s *csiNodeSyncer) ensureContainersSpec() []corev1.Container {
173173
healthPortArg,
174174
},
175175
)
176+
// livenessprobe sidecar container inherits securityContext defined at NodeServer pod level
177+
if livenessProbe.SecurityContext == nil {
178+
livenessProbe.SecurityContext = &corev1.SecurityContext{}
179+
}
176180
fillSecurityContextCapabilities(livenessProbe.SecurityContext)
177181
livenessProbe.ImagePullPolicy = s.getCSINodeDriverRegistrarPullPolicy()
178182
livenessProbe.Resources = getSidecarResourceRequests(s.driver, constants.LivenessProbe)

0 commit comments

Comments
 (0)