diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 89348535..985acc2a 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -4,7 +4,7 @@ description: Installs the given GardenLinux Python library inputs: version: description: GardenLinux Python library version - default: "1.0.4" + default: "1.0.5" python_version: description: Python version to setup default: "3.14" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 834f774f..0b2f4548 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ on: - "[0-9]+.[0-9]+.[0-9]+*" env: - GIT_CLIFF_VERSION: 2.13.1 + GIT_CLIFF_VERSION: 2.14.2 jobs: docs: @@ -50,7 +50,7 @@ jobs: - uses: gardenlinux/python-gardenlinux-lib/.github/actions/setup@main - name: Use cargo cache id: cache-cargo - uses: actions/cache@v5 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # pin@v6.1.0 with: path: | ~/.cargo diff --git a/pyproject.toml b/pyproject.toml index 07832b33..7b08ae69 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "gardenlinux" -version = "1.0.4" +version = "1.0.5" description = "Contains tools to work with the features directory of gardenlinux, for example deducting dependencies from feature sets or validating cnames" authors = ["Garden Linux Maintainers "] license = "Apache-2.0" diff --git a/src/gardenlinux/oci/__main__.py b/src/gardenlinux/oci/__main__.py index bf541ab3..135cc7ab 100755 --- a/src/gardenlinux/oci/__main__.py +++ b/src/gardenlinux/oci/__main__.py @@ -6,8 +6,8 @@ import argparse import json -from pathlib import Path from os import getenv +from pathlib import Path from typing import Optional from .image_manifest import ImageManifest diff --git a/src/gardenlinux/oci/image_manifest.py b/src/gardenlinux/oci/image_manifest.py index 1b265c9d..db28edd9 100644 --- a/src/gardenlinux/oci/image_manifest.py +++ b/src/gardenlinux/oci/image_manifest.py @@ -11,6 +11,7 @@ from typing import Any, Dict from oras.defaults import annotation_title as ANNOTATION_TITLE +from oras.defaults import default_manifest_media_type as IMAGE_MANIFEST_MEDIA_TYPE from ..constants import GL_DISTRIBUTION_NAME, GL_REPOSITORY_URL from ..features import ArtifactBaseName, Flavor @@ -77,6 +78,10 @@ class ImageManifest(Manifest): """ OCI image manifest GardenLinux version annotation """ + IMAGE_MANIFEST_MEDIA_TYPE = IMAGE_MANIFEST_MEDIA_TYPE + """ + OCI image manifest media type + """ @property def arch(self) -> str: diff --git a/src/gardenlinux/oci/repository.py b/src/gardenlinux/oci/repository.py index c8200b0e..99f71e24 100644 --- a/src/gardenlinux/oci/repository.py +++ b/src/gardenlinux/oci/repository.py @@ -154,19 +154,10 @@ def generate_image_manifest( manifest = ImageManifest() manifest.flavor = abn_object.flavor + manifest.feature_set = feature_set manifest.version = version manifest.commit = commit - description = ( - f"Image: {cname}-{architecture}-{version}-{commit}" - f"Flavor: {cname}-{architecture} " - f"Architecture: {architecture} " - f"Features: {feature_set} " - f"Commit: {commit} " - ) - - manifest["annotations"]["org.opencontainers.image.description"] = description - manifest.config_from_dict( {}, {"cname": cname, "architecture": architecture}, @@ -624,7 +615,6 @@ def read_manifest( if cname is None: manifest_type = Manifest - response = self._get_manifest_without_response_parsing(self._repository_tag) else: abn_object = ArtifactBaseName(f"{cname}-{architecture}-{version}-{commit}") @@ -635,7 +625,15 @@ def read_manifest( ) if response.ok: - manifest = manifest_type(**response.json()) + response_data = response.json() + + if ( + response_data.get("mediaType") + == ImageManifest.IMAGE_MANIFEST_MEDIA_TYPE + ): + manifest_type = ImageManifest + + manifest = manifest_type(**response_data) else: response.raise_for_status()