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

Commit a8a6662

Browse files
committed
Fix bug in image digester
1 parent 13e9230 commit a8a6662

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tools/image_digester_.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@
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+
required=False,
55+
help='The path to the file storing the image manifest.')
56+
5157
parser.add_argument(
5258
'--digest',
5359
action='append',
@@ -77,6 +83,7 @@ def main():
7783
# If config is specified, use that. Otherwise, fallback on reading
7884
# the config from the tarball.
7985
config = args.config
86+
manifest = args.manifest
8087
if args.config:
8188
logging.info('Reading config from %r', args.config)
8289
with open(args.config, 'r') as reader:
@@ -86,6 +93,10 @@ def main():
8693
with v2_2_image.FromTarball(args.tarball) as base:
8794
config = base.config_file()
8895

96+
if args.manifest:
97+
with open(args.manifest, 'r') as reader:
98+
manifest = reader.read()
99+
89100
if len(args.digest or []) != len(args.layer or []):
90101
logging.fatal('--digest and --layer must have matching lengths.')
91102
sys.exit(1)
@@ -94,7 +105,8 @@ def main():
94105
with v2_2_image.FromDisk(
95106
config,
96107
list(zip(args.digest or [], args.layer or [])),
97-
legacy_base=args.tarball) as v2_2_img:
108+
legacy_base=args.tarball,
109+
foreign_layers_manifest=manifest) as v2_2_img:
98110

99111
try:
100112
if args.oci:

0 commit comments

Comments
 (0)