Skip to content

Commit 3dcf888

Browse files
authored
fix: add sha256 as an image label (if present) (ethereum#637)
1 parent 5d35463 commit 3dcf888

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/shared_utils/shared_utils.star

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,25 @@ def zfill_custom(value, width):
6666

6767

6868
def label_maker(client, client_type, image, connected_client, extra_labels):
69+
# Extract sha256 hash if present
70+
sha256 = ""
71+
if "@sha256:" in image:
72+
sha256 = image.split("@sha256:")[-1][:8]
73+
74+
# Create the labels dictionary
6975
labels = {
7076
"ethereum-package.client": client,
7177
"ethereum-package.client-type": client_type,
7278
"ethereum-package.client-image": image.replace("/", "-")
7379
.replace(":", "_")
7480
.split("@")[0], # drop the sha256 part of the image from the label
81+
"ethereum-package.sha256": sha256,
7582
"ethereum-package.connected-client": connected_client,
7683
}
77-
labels.update(extra_labels) # Add extra_labels to the labels dictionary
84+
85+
# Add extra_labels to the labels dictionary
86+
labels.update(extra_labels)
87+
7888
return labels
7989

8090

0 commit comments

Comments
 (0)