Skip to content

Commit 2d0db0f

Browse files
committed
refuse to upload in commit_str local case
1 parent 917a23c commit 2d0db0f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/python_gardenlinux_lib/features/parse_features.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ def get_gardenlinux_commit(gardenlinux_root: str, limit: Optional[int] = None) -
4343
if commit_str.count("\n") > 1:
4444
raise ValueError(f"{commit_str} contains multiple lines")
4545

46+
47+
4648
if limit:
4749
if limit >= len(commit_str):
4850
return commit_str
@@ -100,9 +102,11 @@ def get_oci_metadata(cname: str, version: str, gardenlinux_root: str):
100102
"""
101103
oci_layer_metadata_list = list()
102104
features_by_type = get_features_dict(cname, gardenlinux_root)
103-
print(features_by_type)
104105
commit_str = get_gardenlinux_commit(gardenlinux_root, 8)
105106

107+
if commit_str == "local":
108+
raise ValueError("Using local commit. Refusing to upload to OCI Registry")
109+
106110
for arch in ["amd64", "arm64"]:
107111
for platform in features_by_type["platform"]:
108112
image_file_types = deduce_image_filetype(

0 commit comments

Comments
 (0)