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

update image naming scheme, compatibility with ggcr v0.15.2 #289

Merged
merged 2 commits into from
May 19, 2023

Conversation

puerco
Copy link
Member

@puerco puerco commented May 19, 2023

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

This PR modifies the default naming scheme used in SPDX packages when representing container images. The new scheme will now be the expanded image reference @ digest when available. For example the top-level package representing nginx will now be:

    index.docker.io/library/nginx@sha256:480868e8c8c797794257e2abd88d0f9a8809b2fe956cbfbc05dcc0bca1f7cd43

When no reference is available, the name of the package will still be the digest as in sha256:63547654...

Multi-arch images fronted by the index manifest will be named using the same schema while layers keep the digest naming convention. Here is a sample:

 πŸ“‚ SPDX Document SBOM-SPDX-c03bb1e1-b939-4fed-b3e5-66d698dfdb76
  β”‚ 
  β”‚ πŸ“¦ DESCRIBES 1 Packages
  β”‚ 
  β”œ index.docker.io/library/nginx@sha256:480868e8c8c797794257e2abd88d0f9a8809b2fe956cbfbc05dcc0bca1f7cd43
  β”‚  β”‚ πŸ”— 8 Relationships
  β”‚  β”œ CONTAINS PACKAGE index.docker.io/library/nginx@sha256:573aeafa0c5883bb8f93516fe904b47057b4fba547ad310c6967f563e5a2bb07
  β”‚  β”‚  β”‚ πŸ”— 7 Relationships
  β”‚  β”‚  β”œ CONTAINS PACKAGE sha256:9c7c4e67baad3ce38491ce8c1ffaa9ca9ce37409270ce53ab3472054f35d097e
  β”‚  β”‚  β”œ CONTAINS PACKAGE sha256:b4d3566b2dd3e77d74d603c6edfdca033ecac6379238258a3ba8ace3a17aa818
  β”‚  β”‚  β”‚  β”‚ πŸ”— 141 Relationships
  β”‚  β”‚  β”‚  β”œ CONTAINS PACKAGE adduser@3.118
  β”‚  β”‚  β”‚  β”œ CONTAINS PACKAGE apt@2.2.4
  β”‚  β”‚  β”‚  β”œ CONTAINS PACKAGE base-files@11.1+deb11u7
  β”‚  β”‚  β”‚  β”œ CONTAINS PACKAGE base-passwd@3.5.51
  β”‚  β”‚  β”‚  β”œ CONTAINS PACKAGE bash@5.1-2+deb11

Which issue(s) this PR fixes:

This PR also fixes an incompatibility with go-containerregistro v0.15.x that was preventing updating the library.

Special notes for your reviewer:

/assign @cpanato

Does this PR introduce a user-facing change?

SPDX packages representing container images are now named using their full reference and digest: `registry.com/repository/image@sha256:digest`

@puerco puerco requested a review from cpanato May 19, 2023 03:01
@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 19, 2023
@k8s-ci-robot k8s-ci-robot requested a review from Verolop May 19, 2023 03:01
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 19, 2023
@cpanato
Copy link
Member

cpanato commented May 19, 2023

@puerco needs rebase

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 19, 2023
Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 19, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cpanato, puerco

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: Adolfo GarcΓ­a Veytia (Puerco) <puerco@chainguard.dev>
This commit modifies the default naming scheme in SPDX packages
representing container images. The new scheme will now be
the expanded image reference at digest when available.

If an image reference is not available, the package name will be
sha256:digest as it is now.

Signed-off-by: Adolfo GarcΓ­a Veytia (Puerco) <puerco@chainguard.dev>
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 19, 2023
@cpanato
Copy link
Member

cpanato commented May 19, 2023

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 19, 2023
@k8s-ci-robot k8s-ci-robot merged commit 655911f into kubernetes-sigs:main May 19, 2023
7 checks passed
@puerco puerco deleted the ggcr-fix branch May 19, 2023 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants