Skip to content

Commit

Permalink
portainer: sync library (#102)
Browse files Browse the repository at this point in the history
stavros-k authored Aug 7, 2024
1 parent 63a9bfb commit 78d8f99
Showing 2 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ix-dev/community/portainer/app.yaml
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ keywords:
- compose
- container
lib_version: 1.0.0
lib_version_hash: f2610d4386f9f2f65b1e69176effe945f2d9cc7b9489e6386de82f1f63986c4e
lib_version_hash: 909c14fa5586b5738632ff5ec8489eb26af143ecc601cf199df0b8b9e6d6a10c
maintainers:
- email: [email protected]
name: truenas
@@ -49,4 +49,4 @@ sources:
- https://github.com/portainer/portainer
title: Portainer
train: community
version: 1.0.0
version: 1.0.1
Original file line number Diff line number Diff line change
@@ -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)}"

0 comments on commit 78d8f99

Please sign in to comment.