fix: use 0 group id for func-buildpacks Task (#1105)

Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
This commit is contained in:
Zbynek Roubalik 2022-07-12 22:38:12 +02:00 committed by GitHub
parent c57af36f74
commit f4537dd3d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 8 deletions

View File

@ -58,7 +58,9 @@ spec:
default: "1000" default: "1000"
- name: GROUP_ID - name: GROUP_ID
description: The group ID of the builder image user. description: The group ID of the builder image user.
default: "1000" default: "0"
##############################################################
##### "default" has been changed to "0" for Knative Functions
- name: PLATFORM_DIR - name: PLATFORM_DIR
description: The name of the platform directory. description: The name of the platform directory.
default: empty-dir default: empty-dir
@ -87,8 +89,8 @@ spec:
chown -R "$(params.USER_ID):$(params.GROUP_ID)" "$(workspaces.cache.path)" chown -R "$(params.USER_ID):$(params.GROUP_ID)" "$(workspaces.cache.path)"
fi fi
############################################ #######################################################
# "/emptyDir" has been added for Knative Functions ##### "/emptyDir" has been added for Knative Functions
for path in "/tekton/home" "/layers" "/emptyDir" "$(workspaces.source.path)"; do for path in "/tekton/home" "/layers" "/emptyDir" "$(workspaces.source.path)"; do
echo "> Setting permissions on '$path'..." echo "> Setting permissions on '$path'..."
chown -R "$(params.USER_ID):$(params.GROUP_ID)" "$path" chown -R "$(params.USER_ID):$(params.GROUP_ID)" "$path"
@ -143,8 +145,8 @@ spec:
mountPath: /layers mountPath: /layers
- name: $(params.PLATFORM_DIR) - name: $(params.PLATFORM_DIR)
mountPath: /platform mountPath: /platform
############################################ ########################################################
# "/emptyDir" has been added for Knative Functions ##### "/emptyDir" has been added for Knative Functions
- name: empty-dir - name: empty-dir
mountPath: /emptyDir mountPath: /emptyDir
@ -176,7 +178,9 @@ spec:
mountPath: /platform mountPath: /platform
securityContext: securityContext:
runAsUser: 1000 runAsUser: 1000
runAsGroup: 1000 #################################################################
##### "runAsGroup" has been changed to "0" for Knative Functions
runAsGroup: 0
- name: results - name: results
image: docker.io/library/bash:5.1.4@sha256:b208215a4655538be652b2769d82e576bc4d0a2bb132144c060efc5be8c3f5d6 image: docker.io/library/bash:5.1.4@sha256:b208215a4655538be652b2769d82e576bc4d0a2bb132144c060efc5be8c3f5d6
@ -213,8 +217,8 @@ spec:
volumeMounts: volumeMounts:
- name: layers-dir - name: layers-dir
mountPath: /layers mountPath: /layers
############################################ ########################################################
# "/emptyDir" has been added for Knative Functions ##### "/emptyDir" has been added for Knative Functions
- name: empty-dir - name: empty-dir
mountPath: /emptyDir mountPath: /emptyDir