Skip to content

Commit 56c7201

Browse files
authored
Add bazel platform support (#469)
1 parent 66691b8 commit 56c7201

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: bazel/container_structure_test.bzl

+7
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ _attrs = {
1515
values = ["docker", "tar", "host"],
1616
doc = "See https://github.com/GoogleContainerTools/container-structure-test#running-file-tests-without-docker",
1717
),
18+
"platform": attr.string(
19+
default = "linux/amd64",
20+
doc = "Set platform if host is multi-platform capable (default \"linux/amd64\")",
21+
),
1822
"_runfiles": attr.label(default = "@bazel_tools//tools/bash/runfiles"),
1923
"_windows_constraint": attr.label(default = "@platforms//os:windows"),
2024
}
@@ -58,6 +62,9 @@ def _structure_test_impl(ctx):
5862
for arg in ctx.files.configs:
5963
fixed_args.extend(["--config", "$(rlocation %s)" % to_rlocation_path(ctx, arg)])
6064

65+
if ctx.attr.platform:
66+
fixed_args.extend(["--platform", ctx.attr.platform])
67+
6168
bash_launcher = ctx.actions.declare_file("%s.sh" % ctx.label.name)
6269
ctx.actions.write(
6370
bash_launcher,

0 commit comments

Comments
 (0)