Skip to content

Commit b88d821

Browse files
committed
cmd-sign: use manifest-list-digest in meta.json if available
Now that we put the manifest list digest in `meta.json`, we can just use that and not have to pass it through awkwardly via another switch.
1 parent fe430e2 commit b88d821

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/cmd-sign

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ def parse_args():
7575
"public keys to use for signature verification",
7676
default="/etc/pki/rpm-gpg")
7777
robosig.add_argument("--s3-sigstore", help="bucket and prefix to S3 sigstore")
78-
robosig.add_argument("--manifest-list-digest", metavar="ALGO:DIGEST",
79-
help="digest to manifest list to also sign")
8078
robosig.add_argument("--verify-only", action='store_true',
8179
help="verify only that the sigs are valid and make public")
8280
robosig.set_defaults(func=cmd_robosignatory)
@@ -313,6 +311,7 @@ def robosign_oci(args, s3, build, gpgkey):
313311
# in containers-signature(5) to refer to how users will actually be pulling
314312
# the image (which is usually by tag).
315313
identities = {}
314+
manifest_list_digest = None
316315
for arch in builds.get_build_arches(args.build):
317316
build = builds.get_build_meta(args.build, arch)
318317
image = build.get('base-oscontainer')
@@ -325,15 +324,19 @@ def robosign_oci(args, s3, build, gpgkey):
325324
for tag in image['tags']:
326325
identity = f"{image['image']}:{tag}"
327326
identities.setdefault(identity, []).append(image['digest'])
327+
print(f"Signing for {identity} with digest {image['digest']} ({arch})")
328+
if manifest_list_digest is None:
329+
manifest_list_digest = image.get('manifest-list-digest')
328330

329331
# For the manifest list digest, reuse the tags from the x86_64 build. As
330332
# mentioned above, it's the same tags on all arches.
331-
if args.manifest_list_digest:
333+
if manifest_list_digest:
332334
build = builds.get_build_meta(args.build, 'x86_64')
333335
image = build.get('base-oscontainer')
334336
for tag in image['tags']:
335337
identity = f"{image['image']}:{tag}"
336-
identities[identity].append(args.manifest_list_digest)
338+
identities[identity].append(manifest_list_digest)
339+
print(f"Signing for {identity} with digest {manifest_list_digest} (manifest list)")
337340

338341
# add the git commit of ourselves in the signatures for bookkeeping
339342
creator = 'coreos-assembler'

0 commit comments

Comments
 (0)