Skip to content

Commit

Permalink
look at child labels when creating manifest list
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcusk19 committed Jun 25, 2024
1 parent 99d571a commit 5487a80
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions data/registry_model/registry_oci_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
db_transaction,
)
from data.model import DataModelException, QuotaExceededException, namespacequota, oci
from data.model.oci.label import list_manifest_labels
from data.model.oci.retriever import RepositoryContentRetriever
from data.model.oci.tag import get_child_manifests
from data.readreplica import ReadOnlyModeException
from data.registry_model.datatype import FromDictionaryException
from data.registry_model.datatypes import (
Expand Down Expand Up @@ -464,6 +466,21 @@ def create_manifest_and_retarget_tag(
),
None,
)

# If there are child manifests also look at their labels
child_query = get_child_manifests(repository_ref._db_id, wrapped_manifest.id)

child_manifests = child_query.dicts()

for child in child_manifests:
child_labels = list_manifest_labels(
child["child_manifest"], prefix_filter="quay"
)

label_dict = next(
(label.asdict() for label in [Label.for_label(l) for l in child_labels]),
None,
)
else:
label_dict = next(
(
Expand Down

0 comments on commit 5487a80

Please sign in to comment.