-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup WorkingDir for place-tools init container to avoid permission error #3979
Conversation
The way this change currently works it appears we're telling users that they may not use any UID in their TaskRun's One of the steps in this example uses uid I don't think there's anything specific in |
With 1001 user run-steps-as-non-root test can fail because of missing permissions, see tektoncd#3978 Possible solutions is to use 65532 user, which is configured one for gcr.io/distroless/static:nonroot base image or to change working directory to "/" from the default "/home/nonroot" as per GoogleContainerTools/distroless#718 "/" working directory allows to use not only 65532 user, so this path is chosen. Signed-off-by: Yulia Gaponenko <yulia.gaponenko1@de.ibm.com>
@@ -95,6 +95,10 @@ func orderContainers(entrypointImage string, commonExtraEntrypointArgs []string, | |||
initContainer := corev1.Container{ | |||
Name: "place-tools", | |||
Image: entrypointImage, | |||
// Rewrite default WorkingDir from "/home/nonroot" to "/" | |||
// as suggested at https://github.com/GoogleContainerTools/distroless/issues/718 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 nice reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, thank you for pointing me out to the option with WorkingDir, I went deeper and found this great and detailed description of the situation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sbwsg, vdemeester The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test pull-tekton-pipeline-alpha-integration-tests |
Changes
With 1001 user
run-steps-as-non-root
test can fail because of missing access permissions, see #3978Possible solutions are to use 65532 user, which is configured one for gcr.io/distroless/static:nonroot base image or to change working directory to "/" from the default "/home/nonroot"
"/" working directory allows to use not only 65532 user, so this path is chosen.
/kind misc
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
Release Notes