Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omit features field from oci-platform if no contents #1052

Merged
merged 2 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion concourse/steps/publish.mako
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def to_manifest_list_entry(image_ref_template: str, oci_client=oci_client):
architecture=arch,
os=os_id,
variant=cfg_blob.get('variant', None),
features=cfg_blob.get('features', []),
features=cfg_blob.get('features', None),
),
)

Expand Down
5 changes: 4 additions & 1 deletion oci/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ class OciPlatform:
architecture: str
os: str # could also be a dict (see spec)
variant: str | None = None
features: list[str] | None = dataclasses.field(default_factory=list)
features: list[str] | None = None

def as_dict(self) -> dict:
# need custom serialisation, because some OCI registries do not like null-values
Expand All @@ -378,6 +378,9 @@ def as_dict(self) -> dict:
if not self.variant:
del raw['variant']

if not self.features:
del raw['features']

return raw

def __eq__(self, other):
Expand Down
Loading