Skip to content
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

Fix: convert deprecated labels to annotations #141

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Fix: convert deprecated labels to annotations #141

wants to merge 4 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 26, 2018

Patch converts deprecated[0] labels to annotations conformant to OCI
image specifications[1].

[0] - https://github.com/label-schema/label-schema.org#label-schemaorg
[1] - https://github.com/opencontainers/image-spec/blob/master/annotations.md#annotations

Cc: @bobcanthelpyou @remy-tiitre @dgoo2308 @jperrin

@centos-ci
Copy link
Collaborator

Can one of the admins verify this patch?

Patch splits separate layer with the (dynamic) date/time when the
image has been built, from other (static) labels.
@ghost
Copy link
Author

ghost commented Dec 4, 2018

Hello Jim @jperrin and @Habbie Peter,
Please, review this PR. Thank you!

@dgoo2308
Copy link

dgoo2308 commented Dec 4, 2018

Nice work,

but it's missing the org.opencontainers.image.ref.name

with:

RELEASEVER="${KSNAME:7:1}"
ARCH="${KSNAME:8}"
[ -n "${ARCH}" ] && ARCHD="-${ARCH}"

I suggest something in the likes of centos-${RELEASEVER}${ARCHD}-${BUILDATE}, which would result in e.g. :

org.opencontainers.image.ref.name=centos-6-i386-20181201

or for x86_64 CentOS 6:

org.opencontainers.image.ref.name=centos-6-20181201

and would it be nice to extent the title with release and arch CentOS ${RELEASEVER} Base Image ${ARCH} , which would result in e.g. :

org.opencontainers.image.title="CentOS 7 Base Image arm64"

or for x86_64

org.opencontainers.image.title="CentOS 7 Base Image"

while having the description a bit more descriptive, with text from docs repo's :

org.opencontainers.image.description="CentOS ${RELEASEVER} Base Image${ARCH}. CentOS 
Linux is a community-supported distribution derived from sources freely provided to the 
public by Red Hat for Red Hat Enterprise Linux (RHEL). As such, CentOS Linux aims to be 
functionally compatible with RHEL. The CentOS Project mainly changes packages to remove 
upstream vendor branding and artwork. CentOS Linux is no-cost and free to redistribute. Each 
CentOS Linux version is maintained for up to 10 years (by means of security updates -- the 
duration of the support interval by Red Hat has varied over time with respect to Sources 
released). A new CentOS Linux version is released approximately every 2 years and each 
CentOS Linux version is periodically updated (roughly every 6 months) to support newer 
hardware. This results in a secure, low-maintenance, reliable, predictable, and reproducible 
Linux environment"

@dgoo2308
Copy link

dgoo2308 commented Dec 4, 2018

As for:

org.opencontainers.image.source, it should point to this repository as this is the source that creates the image, thus:

org.opencontainers.image.source="https://github.com/CentOS/sig-cloud-instance-build.git"

and the other missing item org.opencontainers.image.revision:

with, e.g.:

COMMIT="$(git describe --always )"

we can set:

org.opencontainers.image.revision="${COMMIT}"

this will, in combination with org.opencontainers.image.source, to trace back to the source commit that produced this image.

PS: I don't known if during the build the commit or git is available.

@ghost
Copy link
Author

ghost commented Feb 6, 2019

Hello, Danny (@dgoo2308). Thank you for your comments and sorry for late reply. I have added org.opencontainers.image.ref.name label, but without a date, as this I believe is supposed to be stable label (people would use it to filter all centos-6-i386 images). I'm a bit afraid of a super long description you have provided as example. Git commit should be available, but I've set it to be full commit ID. I hope this works. Look forward to your feedback.

@jperrin
Copy link
Collaborator

jperrin commented Feb 28, 2019

Sorry for the delay in reviewing this. We've recently made some changes to the kickstart names. Do the changes there break your KSNAME RELEASEVER variable changes?

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.

3 participants