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

Allows to disable the fallback to the default registry on image pull #2637

Merged

Conversation

fgiannetti
Copy link
Contributor

@fgiannetti fgiannetti commented Jul 25, 2023

Fixes #2445

Description

When one or more registry mirror(s) are defined with the 'registry-mirror' flag, if none of those mirrors can pull the image, the current behavior is to fallback to the default registry. If a whitelist (or some image restriction) is applied at the mirror side, fallbacking to the default registry makes that restriction useless. This new argument allows to skip the fallback and abort the build if the mirror do not contains or rejects an image. If it is not set, is completely transparent.

Submitter Checklist

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

The fallback to default registry can be disabled if you defined a registry-mirror list and none of them can make pull of an image.

Examples of user facing changes:
- kaniko adds a new flag `--skip-default-registry-fallback` to disable the fallback to the default registry if none of the  mirrors (if defined) cannot pull an image

When one or more registry mirror(s) are deffined with the 'registry-mirror' argument, if none of those mirrors include the image,
the current behavior is to fallback to the default registry.
If a whitelist (or some image restriction) is applied at the mirror side, fallbacking to the default registry makes that restriction useless.
This new argument allows to skip the fallback and abort the build if the mirror rejects an image.
If it is not set, is completelly transparent.
@google-cla
Copy link

google-cla bot commented Jul 25, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Collaborator

@aaron-prindle aaron-prindle left a comment

Choose a reason for hiding this comment

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

@fgiannetti thanks for the PR here! LGTM!

@aaron-prindle aaron-prindle merged commit c2445c7 into GoogleContainerTools:main Jul 26, 2023
10 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.

Avoid registry fallback
2 participants