From 75889bf6a5648eff0709390e5264461874bc4443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Mon, 13 Mar 2017 20:21:14 +0100 Subject: [PATCH] Update (atomic sign) for the updated sigstore layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The path now does not contain the registry hostname, and the manifest digest uses = instead of : for a separator. Signed-off-by: Miloslav Trmač Closes: #937 Approved by: baude --- Atomic/sign.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Atomic/sign.py b/Atomic/sign.py index 1df6362..8f31835 100644 --- a/Atomic/sign.py +++ b/Atomic/sign.py @@ -117,7 +117,14 @@ class Sign(Atomic): if not os.path.exists(signature_path): raise ValueError("The signature path {} does not exist".format(signature_path)) - sigstore_path = "{}/{}@{}".format(signature_path, expanded_image_name.rsplit(':', 1)[0], manifest_hash) + # remote_path contains neither the registry hostname nor a digest/tag + expanded_image_name_components = util.Decompose(expanded_image_name) + if expanded_image_name_components.repo: + remote_path = expanded_image_name_components.repo + '/' + expanded_image_name_components.image + else: + remote_path = expanded_image_name_components.image + sigstore_path = "{}/{}@{}".format(signature_path, remote_path, manifest_hash.replace(':', '=', 1)) + self.make_sig_dirs(sigstore_path) sig_name = self.get_sig_name(sigstore_path) fq_sig_path = os.path.join(sigstore_path, sig_name)