-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhanced testing and remove run as root (#108)
* adding runAsNonRoot and init containers to set permissions * updating to quotes and typo in security context * adding specific user ids * updating to use runAsUserId in service * updating for platformsvcs to run as non-root * adding logging to tests
- Loading branch information
1 parent
dd6a88a
commit bc7733c
Showing
9 changed files
with
324 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{{- define "spacefx.initcontainers.setperms" }} | ||
{{- $serviceValues := .serviceValues }} | ||
{{- $globalValues := .globalValues }} | ||
{{- $mountPaths := "" }} | ||
initContainers: | ||
- name: init-permissions | ||
image: docker.io/rancher/mirrored-library-busybox:1.36.1 | ||
volumeMounts: | ||
{{- range $volumeKey, $volumeName := $globalValues.xferVolumes }} | ||
{{- $fileServerVolumeMount := printf "%s" (include "spacefx.fileserver.clientapp.volumemount" (dict "globalValues" $globalValues "serviceValues" $serviceValues "volumeName" $volumeName) | nindent 2 | trim) }} | ||
{{- $fileServerVolumeMountPath := printf "%s" (include "spacefx.fileserver.clientapp.volumemount.mountpath" (dict "globalValues" $globalValues "serviceValues" $serviceValues "volumeName" $volumeName) | trim) }} | ||
{{- $mountPaths = printf "%s %s" $mountPaths $fileServerVolumeMountPath }} | ||
{{- printf "- %s" $fileServerVolumeMount | nindent 5 }} | ||
{{- end }} | ||
{{- if $serviceValues.xferVolumes }} | ||
{{- range $volumeKey, $volumeName := $serviceValues.xferVolumes }} | ||
{{- $fileServerVolumeMount := printf "%s" (include "spacefx.fileserver.clientapp.volumemount" (dict "globalValues" $globalValues "serviceValues" $serviceValues "volumeName" $volumeName) | nindent 2 | trim) }} | ||
{{- $fileServerVolumeMountPath := printf "%s" (include "spacefx.fileserver.clientapp.volumemount.mountpath" (dict "globalValues" $globalValues "serviceValues" $serviceValues "volumeName" $volumeName) | trim) }} | ||
{{- $mountPaths = printf "%s %s" $mountPaths $fileServerVolumeMountPath }} | ||
{{- printf "- %s" $fileServerVolumeMount | nindent 5 }} | ||
{{- end }} | ||
{{- end }} | ||
command: ["sh", "-c", "chown -R {{ $serviceValues.runAsUserId }}:{{ $serviceValues.runAsUserId }} {{ $mountPaths }}"] | ||
{{- end }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.