Skip to content

Commit c74ded2

Browse files
fix(validation): do not enforce entry mediatypes
Signed-off-by: whatsacomputertho <[email protected]>
1 parent 6b8b068 commit c74ded2

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

image/oci.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,6 @@ def validate_static(entry: Dict[str, Any]) -> Tuple[bool, str]:
155155
)
156156
if not platform_valid:
157157
return platform_valid, err
158-
159-
# If the mediaType is unsupported, then error
160-
if entry["mediaType"] in UNSUPPORTED_OCI_MANIFEST_MEDIA_TYPES:
161-
return False, f"Unsupported mediaType: {entry['mediaType']}"
162158

163159
# Valid if all of the above are valid
164160
return True, ""

image/v2s2.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,23 @@
1818
MANIFEST_LIST_V2_SCHEMA, \
1919
MANIFEST_LIST_V2_ENTRY_SCHEMA
2020

21-
# A list of mediaTypes which are not supported by the v2s2 manifest spec
21+
# See doc comments below
2222
UNSUPPORTED_V2S2_MANIFEST_MEDIA_TYPES = [
2323
OCI_MANIFEST_MEDIA_TYPE
2424
]
25+
"""
26+
A list of mediaTypes which are not supported by the v2s2 manifest spec.
27+
This mainly just includes the OCI manifest mediaType.
28+
"""
29+
30+
# See doc comments below
2531
UNSUPPORTED_V2S2_MANIFEST_LIST_MEDIA_TYPES = [
2632
OCI_INDEX_MEDIA_TYPE
2733
]
34+
"""
35+
A list of mediaTypes which are not supported by the v2s2 manifest list
36+
spec. This mainly just includes the OCI index mediaType.
37+
"""
2838

2939
"""
3040
ContainerImageManifestV2S2 class
@@ -145,10 +155,6 @@ def validate_static(entry: Dict[str, Any]) -> Tuple[bool, str]:
145155
)
146156
if not platform_valid:
147157
return platform_valid, err
148-
149-
# If the mediaType is unsupported, then error
150-
if entry["mediaType"] in UNSUPPORTED_V2S2_MANIFEST_MEDIA_TYPES:
151-
return False, f"Unsupported mediaType: {entry['mediaType']}"
152158

153159
# Valid if all of the above are valid
154160
return True, ""

0 commit comments

Comments
 (0)