Skip to content
This repository was archived by the owner on Jun 4, 2021. It is now read-only.

Commit 9a201d3

Browse files
authored
Merge pull request #107 from google/image-digest-1536684860
Fix bug in image digester
2 parents 13e9230 + 4da036b commit 9a201d3

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tools/image_digester_.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@
4848
action='store',
4949
help='The path to the file storing the image config.')
5050

51+
parser.add_argument(
52+
'--manifest',
53+
action='store',
54+
help='The path to the file storing the image manifest.')
55+
5156
parser.add_argument(
5257
'--digest',
5358
action='append',
@@ -77,6 +82,7 @@ def main():
7782
# If config is specified, use that. Otherwise, fallback on reading
7883
# the config from the tarball.
7984
config = args.config
85+
manifest = args.manifest
8086
if args.config:
8187
logging.info('Reading config from %r', args.config)
8288
with open(args.config, 'r') as reader:
@@ -86,6 +92,10 @@ def main():
8692
with v2_2_image.FromTarball(args.tarball) as base:
8793
config = base.config_file()
8894

95+
if args.manifest:
96+
with open(args.manifest, 'r') as reader:
97+
manifest = reader.read()
98+
8999
if len(args.digest or []) != len(args.layer or []):
90100
logging.fatal('--digest and --layer must have matching lengths.')
91101
sys.exit(1)
@@ -94,7 +104,8 @@ def main():
94104
with v2_2_image.FromDisk(
95105
config,
96106
list(zip(args.digest or [], args.layer or [])),
97-
legacy_base=args.tarball) as v2_2_img:
107+
legacy_base=args.tarball,
108+
foreign_layers_manifest=manifest) as v2_2_img:
98109

99110
try:
100111
if args.oci:

0 commit comments

Comments
 (0)