Skip to content

Commit

Permalink
Resolved unauthorised access issue for skopeo-copy
Browse files Browse the repository at this point in the history
  • Loading branch information
Senjuti256 authored and openshift-merge-bot[bot] committed Aug 30, 2024
1 parent bb37966 commit 25c7021
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/skopeo-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ exported_or_fail \

declare -x REGISTRY_AUTH_FILE=""

docker_config="${HOME}/.docker/config.json"
docker_config="/workspace/home/.docker/config.json"
if [[ -f "${docker_config}" ]]; then
phase "Setting REGISTRY_AUTH_FILE to '${docker_config}'"
REGISTRY_AUTH_FILE=${docker_config}
Expand Down
3 changes: 3 additions & 0 deletions scripts/skopeo-copy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ set -eu -o pipefail
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
source "$(dirname "${BASH_SOURCE[0]}")/skopeo-common.sh"

# Ensure the /tekton/home/.docker directory exists
mkdir -p /workspace/home/.docker

phase "Copying '${PARAMS_SOURCE_IMAGE_URL}' into '${PARAMS_DESTINATION_IMAGE_URL}'"

set -x
Expand Down
5 changes: 4 additions & 1 deletion templates/task-skopeo-copy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ spec:
volumes:
- name: scripts-dir
emptyDir: {}

stepTemplate:
env:
{{- $variables := list
Expand All @@ -79,6 +79,9 @@ spec:

steps:
- name: skopeo-copy
env:
- name: HOME
value: /workspace/home
image: {{ .Values.images.skopeo }}
script: |
{{- include "load_scripts" ( list . ( list "skopeo-" ) ( list "/scripts/skopeo-copy.sh" "/scripts/skopeo-results.sh" ) ) | nindent 8 }}
Expand Down

0 comments on commit 25c7021

Please sign in to comment.