From b70abf2cb668a4be946d47f7f33c3faec59e55ed Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Mon, 8 Jul 2024 09:50:32 -0400 Subject: [PATCH] Improve method of deriving repo name from pullspec Theoretically, this works if the IMAGE reference contains a port number. Co-authored-by: Adam Cmiel --- task/oci-copy-oci-ta/0.1/oci-copy-oci-ta.yaml | 2 +- task/oci-copy/0.1/oci-copy.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/task/oci-copy-oci-ta/0.1/oci-copy-oci-ta.yaml b/task/oci-copy-oci-ta/0.1/oci-copy-oci-ta.yaml index 3d0f58f0bd..3b7d973eab 100644 --- a/task/oci-copy-oci-ta/0.1/oci-copy-oci-ta.yaml +++ b/task/oci-copy-oci-ta/0.1/oci-copy-oci-ta.yaml @@ -122,7 +122,7 @@ spec: echo "Extracting artifact_type" ARTIFACT_TYPE=$(cat "$(pwd)/source/$OCI_COPY_FILE" | yq '.artifact_type') - REPO=$(echo ${IMAGE} | awk -F ':' '{print $1}') + REPO=${IMAGE%:*} echo "Found that ${REPO} is the repository for ${IMAGE}" cat >artifact-manifest.json <artifact-manifest.json <