Skip to content
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 .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 # [email protected]
with:
path: |
~/.cargo
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/gardenlinux/oci/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/gardenlinux/oci/image_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
22 changes: 10 additions & 12 deletions src/gardenlinux/oci/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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}")
Expand All @@ -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()

Expand Down
Loading