Skip to content

Use standard OCI annotations #2041

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 1 commit into from
Apr 29, 2025
Merged

Conversation

AlexGustafsson
Copy link
Contributor

@AlexGustafsson AlexGustafsson commented Apr 12, 2025

See https://github.com/opencontainers/image-spec/blob/main/annotations.md for a description of all standard annotations.

This change replaces all custom LABEL expressions used in all Dockerfiles used for builds. Additionally, it adds the org.opencontainers.image.source label to ensure that update and scanning tools can identify this source repository from the image.

@AlexGustafsson
Copy link
Contributor Author

There's a couple of changes that's worth to discuss:

  1. I've not changed the name or release labels as there's not any clear standard forms for these. One alternative could be to use the org.opencontainers.image.ref.name label and name them intel/<name>. As for release, the nearest label is org.opencontainers.image.revision but that's more geared towards a SHA-1 or tag.
  2. I haven't really been able to see where the version label hardcoded to devel is overwritten. The logic used there likely needs to be changed to accommodate for the use of the OCI annotations.

@mythi
Copy link
Contributor

mythi commented Apr 14, 2025

the existing labels are based on what Openshift certification checks. @mregmi what do you think?

@tkatila
Copy link
Contributor

tkatila commented Apr 14, 2025

Yeah, the maintainer label was just added a few days ago. We might have to have both: the old and the opencontainers labels.

@AlexGustafsson
Copy link
Contributor Author

In practice I've seen the labels used by Red Hat in use elsewhere so they will likely "have" to be supported by tooling. What lacks a counterpart is the source label. Should we just keep the existing labels and add the source label?

@tkatila
Copy link
Contributor

tkatila commented Apr 14, 2025

In practice I've seen the labels used by Red Hat in use elsewhere so they will likely "have" to be supported by tooling. What lacks a counterpart is the source label. Should we just keep the existing labels and add the source label?

I would wait for @mregmi's feedback. He should have good insights on the topic.

@MartinXuWalnux
Copy link

@chaitanya1731 Could you review this PR and see whether this change compatible with RH certification. Thanks!

@chaitanya1731
Copy link
Contributor

@tkatila @mythi We can add other OCI standard labels in addition to whats already present like @AlexGustafsson mentioned above.
The existing labels are required by RedHat's preflight certification tool to certify and publish the images and the bundle on Redhat Catalog. the preflight tool has a test case that checks for these labels - https://github.com/redhat-openshift-ecosystem/openshift-preflight/blob/02f4582e018e576b6784847a7a916e50f80ea9fa/internal/policy/container/has_required_labels.go#L14

@tkatila
Copy link
Contributor

tkatila commented Apr 23, 2025

Thanks @chaitanya1731

@AlexGustafsson could you change the PR to add these new labels?

@mythi
Copy link
Contributor

mythi commented Apr 23, 2025

I believe the intent of this PR was to fix/change the existing labels to be the "standard ones". We don't need the labels for anything else but that certification stuff.

My preference is to not add double labeling if we cannot change the Redhat required ones. The image-source addition alone seems useful though.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@AlexGustafsson
Copy link
Contributor Author

I've updated the changes to only add the standard OCI image source addition.

@mythi mythi merged commit 80cafbd into intel:main Apr 29, 2025
55 checks passed
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.

None yet

5 participants