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/workflows/bandit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # [email protected].0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # [email protected].1
- uses: ./.github/actions/setup
- name: Simple bandit security checks
run: make security
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # [email protected].0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # [email protected].1
- uses: ./.github/actions/setup
- run: make lint
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # [email protected].0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # [email protected].1
- uses: ./.github/actions/setup
- name: Simple poetry build no package
run: make build
2 changes: 1 addition & 1 deletion .github/workflows/pytests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
python_version: ["3.13", "3.14"]
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # [email protected].0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # [email protected].1
with:
fetch-depth: 2

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # [email protected].0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # [email protected].1
- uses: gardenlinux/python-gardenlinux-lib/.github/actions/setup@main
- run: make docs
- if: ${{ github.ref_type != 'tag' }}
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
id: get-tag-name
run: echo "tag-name=${GITHUB_REF/refs\/tags\//}" | tee -a "$GITHUB_OUTPUT"
- name: Checkout commit
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # [email protected].0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # [email protected].1
with:
fetch-depth: 0
ref: ${{ steps.get-tag-name.outputs.tag-name }}
Expand Down
2 changes: 1 addition & 1 deletion src/gardenlinux/oci/image_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ def write_metadata_file(self, manifest_file_path_name: PathLike[str] | str) -> N
manifest_file_path_name = Path(manifest_file_path_name)

metadata = deepcopy(empty_manifest_metadata)
metadata["mediaType"] = "application/vnd.oci.image.manifest.v1+json"
metadata["mediaType"] = IMAGE_MANIFEST_MEDIA_TYPE
metadata["digest"] = self.digest
metadata["size"] = self.size
metadata["annotations"] = self.extended_dict["annotations"]
Expand Down
13 changes: 12 additions & 1 deletion src/gardenlinux/oci/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from typing import Any, Dict

from .image_manifest import ImageManifest
from .manifest import Manifest
from .schemas import empty_index


Expand Down Expand Up @@ -99,6 +100,9 @@ def append_manifest(self, manifest: Dict[str, Any]) -> None:

image_manifest = ImageManifest(manifest)

if image_manifest.size < 1:
raise ValueError("Manifest to be added is empty")

existing_manifest_index = 0

for existing_manifest in self["manifests"]:
Expand All @@ -122,4 +126,11 @@ def append_manifest(self, manifest: Dict[str, Any]) -> None:
if len(self["manifests"]) > existing_manifest_index:
self["manifests"].pop(existing_manifest_index)

self["manifests"].append(manifest)
index_manifest = Manifest()
index_manifest["mediaType"] = image_manifest["mediaType"]
index_manifest["digest"] = image_manifest.digest
index_manifest["size"] = image_manifest.size
index_manifest["annotations"] = image_manifest["annotations"]
index_manifest["platform"] = image_manifest.get("platform", {})

self["manifests"].append(index_manifest)
Loading