Skip to content

Commit 4186047

Browse files
committed
move new features to separate MRs
1 parent 5d67ae5 commit 4186047

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

cosign/private/attest.sh.tpl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,14 @@ fi
1717

1818
REPOSITORY=""
1919
ARGS=()
20+
PREDICATE=""
2021

2122
while (( $# > 0 )); do
2223
case "$1" in
2324
--repository) shift; REPOSITORY="$1"; shift ;;
2425
(--repository=*) REPOSITORY="${1#--repository=}"; shift ;;
26+
--predicate) shift; PREDICATE="$(rlocation "$1")"; shift ;;
27+
(--predicate=*) PREDICATE="$(rlocation "${1#--predicate=}")"; shift ;;
2528
*) ARGS+=( "$1" ); shift ;;
2629
esac
2730
done
@@ -31,5 +34,5 @@ if [[ -z "${REPOSITORY}" ]]; then
3134
exit 1
3235
fi
3336

34-
exec "${COSIGN}" attest "${REPOSITORY}@${DIGEST}" ${ARGS[@]+"${ARGS[@]}"}
37+
exec "${COSIGN}" attest "${REPOSITORY}@${DIGEST}" --predicate "${PREDICATE}" ${ARGS[@]+"${ARGS[@]}"}
3538

oci/private/load.bzl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,6 @@ attrs = {
118118
executable = True,
119119
cfg = "target",
120120
),
121-
"tarball_name": attr.string(
122-
default = "tarball.tar",
123-
doc = "Name of the tarball file to generate.",
124-
),
125121
"_run_template": attr.label(
126122
default = Label("//oci/private:load.sh.tpl"),
127123
doc = """ \
@@ -187,7 +183,7 @@ def _load_impl(ctx):
187183

188184
# This action produces a large output and should rarely be used as it puts load on the cache.
189185
# It will only run if the "tarball" output_group is explicitly requested
190-
tarball = ctx.actions.declare_file("{}/{}".format(ctx.label.name, ctx.attr.tarball_name))
186+
tarball = ctx.actions.declare_file("{}/tarball.tar".format(ctx.label.name))
191187
tar_inputs = depset(direct = mtree_outputs, transitive = [mtree_inputs])
192188
tar_args = ctx.actions.args()
193189
tar_args.add_all(["--create", "--no-xattr", "--no-mac-metadata"])

oci/private/load.sh.tpl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ elif command -v docker &> /dev/null; then
1515
CONTAINER_CLI="docker"
1616
elif command -v podman &> /dev/null; then
1717
CONTAINER_CLI="podman"
18-
elif command -v nerdctl &> /dev/null; then
19-
CONTAINER_CLI="nerdctl"
2018
else
21-
echo >&2 "Neither docker or podman or nerdctl could be found."
19+
echo >&2 "Neither docker or podman could be found."
2220
echo >&2 "To use a different container runtime, pass an executable to the 'loader' attribute of oci_tarball."
2321
exit 1
2422
fi

0 commit comments

Comments
 (0)