Skip to content

Commit d5e8479

Browse files
authored
feat: js_image_layer allow configurable directory/file permissions (#2313)
* add directory_mode & file_mode attribute impl * update docs to include file_mode,directory_mode attributes
1 parent c56b4a5 commit d5e8479

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

docs/js_image_layer.md

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/private/js_image_layer.bzl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,8 @@ else {
395395
"{{ENTRIES}}": entries_json.path,
396396
"'{{PRESERVE_SYMLINKS}}'": json.encode(ctx.attr.preserve_symlinks),
397397
"{{UNUSED_INPUTS}}": unused_inputs.path,
398+
"{{DIRECTORY_MODE}}": ctx.attr.directory_mode,
399+
"{{FILE_MODE}}": ctx.attr.file_mode,
398400
"/*{{VARIABLES}}*/": VARIABLES,
399401
"/*{{PICK_STATEMENTS}}*/": PICK_STATEMENTS,
400402
"/*{{WRITE_STATEMENTS}}*/": WRITE_STATEMENTS,
@@ -642,6 +644,14 @@ js_image_layer_lib = struct(
642644
doc = "Owner of the entries, in `GID:UID` format. By default `0:0` (root, root) is used.",
643645
default = "0:0",
644646
),
647+
"directory_mode": attr.string(
648+
doc = "Mode of the directories, in `octal` format. By default `0755` is used.",
649+
default = "0755",
650+
),
651+
"file_mode": attr.string(
652+
doc = "Mode of the files, in `octal` format. By default `0555` is used.",
653+
default = "0555",
654+
),
645655
"compression": attr.string(
646656
doc = "Compression algorithm. See https://github.com/bazel-contrib/bazel-lib/blob/bdc6ade0ba1ebe88d822bcdf4d4aaa2ce7e2cd37/lib/private/tar.bzl#L29-L39",
647657
values = tar_lib.common.accepted_compression_types + ["none"],

js/private/js_image_layer.mjs

Lines changed: 2 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)