Fix namespace-less containers in image-serve

The build_catalog() function expects the manifests, tags and blobs be
available before the catalog will recognized a container image. The
previous spot where this function was called was after the manifests but
before the tags are created.  This causes the newly uploaded container
not to be listed in the catalog. This change moves the build_catalog()
to last so new images get correctly added to the catalog.

Change-Id: I3f08fe0efef1e830b034fab06574a05dff89ccc0
Closes-Bug: #1950352
(cherry picked from commit f8eeb0dd83)
This commit is contained in:
Alex Schultz 2021-11-09 11:04:55 -07:00
parent b26f4d4e8e
commit 238def5e4f
1 changed files with 1 additions and 1 deletions

View File

@ -267,7 +267,6 @@ def export_manifest_config(target_url,
htaccess_path = os.path.join(manifest_dir_path, '.htaccess')
make_dir(manifest_dir_path)
build_catalog()
with open(manifests_htaccess_path, 'w+') as f:
f.write('AddHandler type-map %s\n' % TYPE_MAP_EXTENSION)
@ -310,6 +309,7 @@ def export_manifest_config(target_url,
if manifest_dict:
write_type_map_file(image, tag, manifest_dict)
build_tags_list(image)
build_catalog()
def write_type_map_file(image, tag, manifest_dict):