From da59266c70b78cc0dddf8fa1255e32fcb486908f 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 e3be6485a7..0c4ebf28fe 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 @@ -120,7 +120,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 <