From b376657b41e40b6e6a185908352d5e40fdf71812 Mon Sep 17 00:00:00 2001 From: Brett Jones Date: Sat, 4 Feb 2023 14:39:54 -0600 Subject: [PATCH] dokku_image: Detect unchanged docker images (#157) `dokku git:from-image` command exits with a code of `1` if the image is already up to date. This resulted in `dokku_image` not being idempotent. --- library/dokku_image.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/dokku_image.py b/library/dokku_image.py index b38be37..bfe1198 100644 --- a/library/dokku_image.py +++ b/library/dokku_image.py @@ -94,6 +94,9 @@ def dokku_image(data): meta[ "error" ] = "Please upgrade to dokku>=0.24.0 in order to use the 'git:from-image' command." + elif "No changes detected, skipping git commit" in str(e.output): + is_error = False + has_changed = False else: meta["error"] = str(e.output) return (is_error, has_changed, meta)