Skip to content

Commit

Permalink
Remove the default security context from the generated deployment des…
Browse files Browse the repository at this point in the history
…criptors.
  • Loading branch information
scottexton committed Oct 28, 2021
1 parent 4fc15a5 commit 777c51d
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions src/controllers/ibmsecurityverifyaccess_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,6 @@ func (r *IBMSecurityVerifyAccessReconciler) createSecret(
* We will pre-propulate:
* - metadata
* - spec.selector
* - template.spec.securityContext.runAsUser
* - template.spec.securityContext.runAsNonRoot
* - template.spec.containers[0].name
* - template.spec.containers[0].ports
* - template.spec.containers[0].livenessProbe
Expand Down Expand Up @@ -388,21 +386,6 @@ func (r *IBMSecurityVerifyAccessReconciler) deploymentForVerifyAccess(
}

falseVar := false
trueVar := true

/*
* The security context to be used.
*/

isvaUser := int64(6000)
securityContext := m.Spec.Container.SecurityContext

if securityContext == nil {
securityContext = &corev1.SecurityContext {
RunAsNonRoot: &trueVar,
RunAsUser: &isvaUser,
}
}

/*
* The port which is exported by the deployment.
Expand Down Expand Up @@ -579,7 +562,7 @@ func (r *IBMSecurityVerifyAccessReconciler) deploymentForVerifyAccess(
Ports: ports,
ReadinessProbe: readinessProbe,
Resources: m.Spec.Container.Resources,
SecurityContext: securityContext,
SecurityContext: m.Spec.Container.SecurityContext,
StartupProbe: startupProbe,
VolumeDevices: m.Spec.Container.VolumeDevices,
VolumeMounts: m.Spec.Container.VolumeMounts,
Expand Down

0 comments on commit 777c51d

Please sign in to comment.