From 01050e6f4617954d5c772fd677b15b481699829b Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Thu, 20 Oct 2022 13:08:33 -0400 Subject: [PATCH] cmd-push-container-manifest: change image key schema The `oscontainer` and `base-oscontainer` keys should follow the same schema. Currently, the former has a `digest` field, while the other one does not. Tweak `cosa push-container-manifest` and `cosa push-container` so that they follows the new schema. (Though note the latter command will be deleted soon). To keep previous 4.12 `meta.json` files valid, this loosens the `image` schema definition so that `digest` is now optional. Once we branch for 4.12, we will undo this change so that it becomes required again. Fixes https://github.com/coreos/coreos-assembler/issues/3122 (cherry picked from commit 738cb390252f737176b15e53db397c6ed924150b) jlebon: I skipped backporting the changes to the schema since we don't need to be as flexible for 4.11. I also skipped the similar change to `cmd-push-container` since we're not planning to use that at all in the new pipeline. (cherry picked from commit b5a3842b7ad3320643573e7c9075e0fbe84b5bf8) (cherry picked from commit 2af1bd0b3c9bc53757cf1362c8a64fa53d35dda1) --- src/cmd-push-container-manifest | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cmd-push-container-manifest b/src/cmd-push-container-manifest index a02867c98a..e0f61b666f 100755 --- a/src/cmd-push-container-manifest +++ b/src/cmd-push-container-manifest @@ -68,7 +68,10 @@ def main(): # Update the meta.json in each build/arch metadata for _, buildmeta in buildmetas.items(): - buildmeta[args.metajsonname] = {'image': f"{args.repo}@{digest}"} + buildmeta[args.metajsonname] = { + 'image': args.repo, + 'digest': digest + } buildmeta.write(artifact_name=args.metajsonname)