Skip to content

Commit ae5f1b9

Browse files
authored
feat: add support for owner (#556)
A follow up pr to adding `owner` to `py_image_layer`. This will allow an us to pass `group` to the image layer for that group ownership attribution #545 --- ### Changes are visible to end-users: yes <!-- If no, please delete this section. --> - Searched for relevant documentation and updated as needed: no - Breaking change (forces users to change their own code or config): no - Suggested release notes appear below: no ### Test plan - Covered by existing test cases
1 parent e6c2cfd commit ae5f1b9

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

MODULE.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module(
1212
# py_image_layer requires 2.x for the `tar` rule.
1313
# py_image_layer needs compute_unused_inputs attribute
1414
# py_image_layer needs repo_mapping fix.
15-
bazel_dep(name = "aspect_bazel_lib", version = "2.10.0")
15+
bazel_dep(name = "aspect_bazel_lib", version = "2.16.0")
1616
bazel_dep(name = "bazel_skylib", version = "1.4.2")
1717
bazel_dep(name = "rules_python", version = "0.29.0")
1818
bazel_dep(name = "platforms", version = "0.0.7")

docs/py_image_layer.md

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

py/private/py_image_layer.bzl

+3
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def py_image_layer(
100100
compute_unused_inputs = 1,
101101
platform = None,
102102
owner = None,
103+
group = None,
103104
**kwargs):
104105
"""Produce a separate tar output for each layer of a python app
105106
@@ -130,6 +131,7 @@ def py_image_layer(
130131
compute_unused_inputs: Whether to compute unused inputs. Default is 1. See: https://github.com/bazel-contrib/bazel-lib/blob/main/docs/tar.md#tar_rule-compute_unused_inputs
131132
platform: The platform to use for the transition. Default is None. See: https://github.com/bazel-contrib/bazel-lib/blob/main/docs/transitions.md#platform_transition_binary-target_platform
132133
owner: An owner uid for the uncompressed files. See mtree_mutate: https://github.com/bazel-contrib/bazel-lib/blob/main/docs/tar.md#mutating-the-tar-contents
134+
group: A group uid for the uncompressed files. See mtree_mutate: https://github.com/bazel-contrib/bazel-lib/blob/main/docs/tar.md#mutating-the-tar-contents
133135
tar_args: Additional arguments to pass to the tar rule. Default is `[]`. See: https://github.com/bazel-contrib/bazel-lib/blob/main/docs/tar.md#tar_rule-args
134136
**kwargs: attribute that apply to all targets expanded by the macro
135137
@@ -152,6 +154,7 @@ def py_image_layer(
152154
name = manifest_name,
153155
mtree = name + ".manifest.preprocessed",
154156
owner = owner,
157+
group = group,
155158
)
156159
else:
157160
mtree_spec(

0 commit comments

Comments
 (0)