Skip to content

allow adding additional tags to OCI index and manifests #111

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

Merged
merged 6 commits into from
Jun 4, 2025

Conversation

yeoldegrove
Copy link
Contributor

@yeoldegrove yeoldegrove commented May 22, 2025

What this PR does / why we need it:

gardenlinux/gardenlinux#2754 outlines the restructure of OCI release tags.
To actually add additional tags to the OCI index and manifests, a new paramter --additional-tag has to be added to the gl-oci update-index|push-manifest calls.

Additionally this adds:

  • retry_on_error decoration for blob_upload (CI tests will fail else wise)
  • make targets make test-debug and make test-trace to debug OCI tagging
  • pythonic way to generate test data (as tests are extended quite a bit)

Special notes for your reviewer:

@yeoldegrove yeoldegrove changed the title restructure OCI release tags allow adding additional tags to OCI index and manifests May 22, 2025
@yeoldegrove yeoldegrove force-pushed the feat/oci_tagging branch 4 times, most recently from db91efb to 8bc6eea Compare May 22, 2025 08:57
@yeoldegrove yeoldegrove self-assigned this May 22, 2025
@yeoldegrove yeoldegrove force-pushed the feat/oci_tagging branch 2 times, most recently from 01c7621 to 9715853 Compare May 22, 2025 11:36
@yeoldegrove yeoldegrove marked this pull request as ready for review May 22, 2025 11:39
for artifact in oci_metadata:
if artifact["media_type"] == "application/io.gardenlinux.release":
file = open(f"{directory}/{artifact["file_name"]}", "r")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use configparser.ConfigParser here as it will be compatible with the file content and makes the code more readable :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

configparser seems to be designed for ini files (is compatible to env-files though) but fileshttps://docs.python.org/3/library/configparser.html#unnamed-sections seems to be a python 3.13 feature.
Garden Linux already has python 3.13 so we could bump the python version.

Added an implementation hat needs python 3.13.

@yeoldegrove yeoldegrove added this to the 2025-05 milestone May 26, 2025
adds the possibility to get debug logs for pytest
e.g. debug which OCI tags exist
add create_test_data to conftest
remove generate_test_certificates from helper as it is on conftest already
@yeoldegrove yeoldegrove requested a review from NotTheEvilOne June 2, 2025 08:47
@yeoldegrove yeoldegrove modified the milestones: 2025-05, 2025-06 Jun 2, 2025
Copy link
Contributor

@NotTheEvilOne NotTheEvilOne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yeoldegrove yeoldegrove merged commit 3c3e366 into main Jun 4, 2025
9 checks passed
NotTheEvilOne pushed a commit that referenced this pull request Jun 4, 2025
* add a retry_on_error decoration for gardenlinux.oci

* add make targets test-debug and test-trace

adds the possibility to get debug logs for pytest
e.g. debug which OCI tags exist

* generate test data in a pythonic way

add create_test_data to conftest
remove generate_test_certificates from helper as it is on conftest already

* add gardenlinux.oci.registry.push_additional_tags_manifest

enables pushing additional tags to OCI manifest

* update gardenlinux.oci.registry.update_index

enables pushing additional tags to OCI index

* rename src/gardenlinux/oci/helper.py src/gardenlinux/oci/wrapper.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants