Skip to content

Commit

Permalink
refactor: remove workdir workaround (#393)
Browse files Browse the repository at this point in the history
  • Loading branch information
thesayyn authored Nov 29, 2023
1 parent 87c72ec commit 08f5f24
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
7 changes: 0 additions & 7 deletions oci/private/image.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ REGISTRY=
REGISTRY=$(start_registry "${STORAGE_DIR}" "${STDERR}")

OUTPUT=""
WORKDIR=""
FIXED_ARGS=()
ENV_EXPANSIONS=()

Expand All @@ -96,7 +95,6 @@ for ARG in "$@"; do
(oci:empty_base) FIXED_ARGS+=("$(empty_base $REGISTRY $@)") ;;
(oci:layout*) FIXED_ARGS+=("$(base_from_layout ${ARG/oci:layout\/} $REGISTRY)") ;;
(--output=*) OUTPUT="${ARG#--output=}" ;;
(--workdir=*) WORKDIR="${ARG#--workdir=}" ;;
(--env-file=*)
# NB: the '|| [-n $in]' expression is needed to process the final line, in case the input
# file doesn't have a trailing newline.
Expand Down Expand Up @@ -161,11 +159,6 @@ if [ ${#ENV_EXPANSIONS[@]} -ne 0 ]; then
REF=$("${CRANE}" mutate "${REF}" ${environment_args[@]})
fi

# TODO: https://github.com/google/go-containerregistry/issues/1515
if [ -n "${WORKDIR}" ]; then
REF=$("${CRANE}" config "${REF}" | "${JQ}" --arg workdir "${WORKDIR}" '.config.WorkingDir = $workdir' | "${CRANE}" edit config "${REF}")
fi

if [ -n "$OUTPUT" ]; then
"${CRANE}" pull "${REF}" "./${OUTPUT}" --format=oci
fi
Expand Down
2 changes: 1 addition & 1 deletion oci/private/versions.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"Mirror of release info"

# WARNING: only v0.12.0 and above is supported.
# WARNING: only v0.15.1 and above is supported due to --workdir feature.
CRANE_VERSIONS = {
"v0.16.1": {
"go-containerregistry-0": "sha256-KHa1NgQVE4cW1YN6aeHBFhgOSOz2KmP1MBw1HVoS+Zs=",
Expand Down
2 changes: 1 addition & 1 deletion scripts/mirror_releases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ REPOSITORY=${1:-"google/go-containerregistry"}
(
curl --silent \
--header "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${REPOSITORY}/releases?per_page=1 \
https://api.github.com/repos/${REPOSITORY}/releases?per_page=4 \
| jq -f $SCRIPT_DIR/filter.jq
) > $RAW

Expand Down

0 comments on commit 08f5f24

Please sign in to comment.