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

Support warming images by digest #1629

Merged
merged 1 commit into from
Apr 22, 2021

Conversation

colinking
Copy link
Contributor

@colinking colinking commented Apr 20, 2021

Description

This PR adds support to the Kaniko warmer for referencing images by digest.

Before:

❯ go run ./cmd/warmer --cache-dir ./test --image=node@sha256:91ec6cb0d47628e4c1ace1efe3835aaddb2a16a9549da4f86782bb05437c53d2 --customPlatform=linux/amd64
Failed warming cache: Failed to verify image name: node@sha256:91ec6cb0d47628e4c1ace1efe3835aaddb2a16a9549da4f86782bb05437c53d2: repository can only contain the runes `abcdefghijklmnopqrstuvwxyz0123456789_-./`: node@sha256
exit status 1

After:

❯ go run ./cmd/warmer --cache-dir ./test --image=node@sha256:91ec6cb0d47628e4c1ace1efe3835aaddb2a16a9549da4f86782bb05437c53d2 --customPlatform=linux/amd64
INFO[0000] Retrieving image manifest node@sha256:91ec6cb0d47628e4c1ace1efe3835aaddb2a16a9549da4f86782bb05437c53d2
INFO[0000] Retrieving image node@sha256:91ec6cb0d47628e4c1ace1efe3835aaddb2a16a9549da4f86782bb05437c53d2 from registry index.docker.io

❯ ls -la ./test
total 680712
drwxr-xr-x   4 colin  staff        128 Apr 20 12:32 .
drwxr-xr-x  36 colin  staff       1152 Apr 20 12:32 ..
-rw-r--r--   1 colin  staff  348519424 Apr 20 12:32 sha256:91ec6cb0d47628e4c1ace1efe3835aaddb2a16a9549da4f86782bb05437c53d2
-rw-r--r--   1 colin  staff       2214 Apr 20 12:32 sha256:91ec6cb0d47628e4c1ace1efe3835aaddb2a16a9549da4f86782bb05437c53d2.json

Submitter Checklist

Not sure if this change qualifies the need for new unit tests :)

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes unit tests
  • Adds integration tests if needed.

See the contribution guide for more details.

Reviewer Notes

  • The code flow looks good.
  • Unit tests and or integration tests added.

Release Notes

Updates the warmer to support --image references by digest, such as --image node@sha256:91ec6cb0d47628e4c1ace1efe3835aaddb2a16a9549da4f86782bb05437c53d2

@google-cla google-cla bot added the cla: yes CLA signed by all commit authors label Apr 20, 2021
@tejal29 tejal29 merged commit b33f965 into GoogleContainerTools:master Apr 22, 2021
@colinking colinking deleted the colin-warm-digest branch April 22, 2021 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes CLA signed by all commit authors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants