diff --git a/ix-dev/community/portainer/app.yaml b/ix-dev/community/portainer/app.yaml index 3d3b2ca65d..639dfd0506 100644 --- a/ix-dev/community/portainer/app.yaml +++ b/ix-dev/community/portainer/app.yaml @@ -29,7 +29,7 @@ keywords: - compose - container lib_version: 1.0.0 -lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e +lib_version_hash: 909c14fa5586b5738632ff5ec8489eb26af143ecc601cf199df0b8b9e6d6a10c maintainers: - email: dev@ixsystems.com name: truenas @@ -49,4 +49,4 @@ sources: - https://github.com/portainer/portainer title: Portainer train: community -version: 1.0.0 +version: 1.0.1 diff --git a/ix-dev/community/portainer/templates/library/base_v1_0_0/utils.py b/ix-dev/community/portainer/templates/library/base_v1_0_0/utils.py index 9a75e846cb..0fee6d2d65 100644 --- a/ix-dev/community/portainer/templates/library/base_v1_0_0/utils.py +++ b/ix-dev/community/portainer/templates/library/base_v1_0_0/utils.py @@ -1,3 +1,4 @@ +import hashlib import secrets import sys @@ -65,6 +66,18 @@ def get_image(images={}, name=""): if name not in images: throw_error(f"Expected [images.{name}] to be set") if not images[name].get("repository") or not images[name].get("tag"): - throw_error(f"Expected [images.{name}.repository] and [images.{name}.tag] to be set") + throw_error( + f"Expected [images.{name}.repository] and [images.{name}.tag] to be set" + ) return f"{images[name]['repository']}:{images[name]['tag']}" + + +def hash_data(data=""): + if not data: + throw_error("Expected [data] to be set") + return hashlib.sha256(data.encode("utf-8")).hexdigest() + + +def get_image_with_hashed_data(images={}, name="", data=""): + return f"ix-{get_image(images, name)}-{hash_data(data)}"