Skip to content
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

Remove unnecessary root user & fix secret name #15

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions kubernetes/tekton-resources/demo/kaniko-with-cosign.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ spec:
- verify-dockerfile
- -key=https://drive.google.com/uc?export=download&id=1GYT5xnhDgY79AJ8prNyVPC52rTGdFQpg
- $(params.DOCKERFILE)
securityContext:
runAsUser: 0
- name: build-and-push
workingDir: $(workspaces.source.path)
image: $(params.BUILDER_IMAGE)
Expand All @@ -78,12 +76,8 @@ spec:
# kaniko assumes it is running as root, which means this example fails on platforms
# that default to run containers as random uid (like OpenShift). Adding this securityContext
# makes it explicit that it needs to run as root.
securityContext:
runAsUser: 0
- name: write-url
image: bash
script: |
set -e
echo $(params.IMAGE) | tee $(results.IMAGE_URL.path)
securityContext:
runAsUser: 0
echo $(params.IMAGE) | tee $(results.IMAGE_URL.path)
2 changes: 1 addition & 1 deletion kubernetes/tekton-resources/demo/pipeline-run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ spec:
claimName: kaniko-source-pvc
- name: docker-secrets
secret:
secretName: secret-dockerconfigjson
secretName: regcred
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing it this way will fail. Regcred in this namespace is set to .dockerconfigjson and the kaniko task needs to have an opaque secret that is a config.json since the kaniko task doesn't correctly use the .dockerconfigjson model.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There must be something broken in one of the scripts upstream then - this is not working with current config for me. Will dig a little deeper