Commit 3dcf8883 authored by Barnabas Busa's avatar Barnabas Busa Committed by GitHub

fix: add sha256 as an image label (if present) (#637)

parent 5d354638
...@@ -66,15 +66,25 @@ def zfill_custom(value, width): ...@@ -66,15 +66,25 @@ def zfill_custom(value, width):
def label_maker(client, client_type, image, connected_client, extra_labels): def label_maker(client, client_type, image, connected_client, extra_labels):
# Extract sha256 hash if present
sha256 = ""
if "@sha256:" in image:
sha256 = image.split("@sha256:")[-1][:8]
# Create the labels dictionary
labels = { labels = {
"ethereum-package.client": client, "ethereum-package.client": client,
"ethereum-package.client-type": client_type, "ethereum-package.client-type": client_type,
"ethereum-package.client-image": image.replace("/", "-") "ethereum-package.client-image": image.replace("/", "-")
.replace(":", "_") .replace(":", "_")
.split("@")[0], # drop the sha256 part of the image from the label .split("@")[0], # drop the sha256 part of the image from the label
"ethereum-package.sha256": sha256,
"ethereum-package.connected-client": connected_client, "ethereum-package.connected-client": connected_client,
} }
labels.update(extra_labels) # Add extra_labels to the labels dictionary
# Add extra_labels to the labels dictionary
labels.update(extra_labels)
return labels return labels
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment