Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions container/incremental_load.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,9 @@ function read_variables() {
%{tag_statements}

# An optional "docker run" statement for invoking a loaded container.
# This is not executed if the single argument --norun is passed.
if [ "a$*" != "a--norun" ]; then
# This is not executed if the single argument --norun is passed or
# no run_statements are generated (in which case, 'run' is 'False').
if [[ "a$*" != "a--norun" && "%{run}" == "True" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can probably reuse run_statements and check if that's not an empty string here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was hesitant to do that -- run_statements can be modified by the consumer's docker_run_flags attribute, and this might contain double quotes.

# Once we've loaded the images for all layers, we no longer need the temporary files on disk.
# We can clean up before we exec docker, since the exit handler will no longer run.
cleanup
Expand Down
1 change: 1 addition & 0 deletions container/layer_tools.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ def incremental_load(
"%{docker_tool_path}": toolchain_info.tool_path,
"%{load_statements}": "\n".join(load_statements),
"%{run_statements}": "\n".join(run_statements),
"%{run}": str(run),
# If this rule involves stamp variables than load them as bash
# variables, and turn references to them into bash variable
# references.
Expand Down