Skip to content

Commit

Permalink
fix: remove workaround for missing crane workdir support
Browse files Browse the repository at this point in the history
  • Loading branch information
gzm0 committed Oct 25, 2023
1 parent 50bb6b8 commit 4424405
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
1 change: 1 addition & 0 deletions e2e/crane_as_registry/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ oci_image(
"--arg2",
],
entrypoint = ["/custom_bin"],
workdir = "/custom_dir",
env = {
"ENV": "/test",
},
Expand Down
7 changes: 1 addition & 6 deletions oci/private/image.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ 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=}" ;;
(--workdir=*) FIXED_ARGS+=("$ARG") ;;
(--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 @@ -155,11 +155,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

0 comments on commit 4424405

Please sign in to comment.