Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Do not fail in case of empty image label values #2276

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions container/image.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def _image_config(
labels_fixed = dict()
for label in labels:
fname = labels[label]
if fname[0] == "@":
if fname.startswith("@"):
labels_fixed[label] = "@" + label_file_dict[fname[1:]].path
else:
labels_fixed[label] = fname
Expand Down Expand Up @@ -1034,7 +1034,7 @@ def container_image(**kwargs):
fail("reserved for internal use by container_image macro", attr = reserved)

if "labels" in kwargs:
files = sorted({v[1:]: None for v in kwargs["labels"].values() if v[0] == "@"}.keys())
files = sorted({v[1:]: None for v in kwargs["labels"].values() if v.startswith("@")}.keys())
kwargs["label_files"] = files
kwargs["label_file_strings"] = files

Expand Down