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

Authenticate for CacheFrom via input credentials on Image #500

Merged
merged 5 commits into from
Feb 16, 2023

Conversation

guineveresaenger
Copy link
Contributor

@guineveresaenger guineveresaenger commented Feb 16, 2023

This PR refactors the registry authentication logic into its own function.
We can now authenticate as-needed for either a registry pull cache or for pushing an image. We reuse the fallback logic to enable us to refer to resource-based registry credentials when provided, and attempt to use ambient credentials when they are not otherwise provided.
Because of the way auth objects get passed, failing to authenticate to a registry-as-cache will not block the build; Docker will attempt to use the local cache or otherwise build from scratch.

  • First pass at auth logic from the image inputs
  • Refactor auth functionality into function to reuse
  • Log into registry only once
  • remove debug statements
  • Add documentation to cacheFrom

Fixes #495

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Copy link
Contributor

@AaronFriel AaronFriel left a comment

Choose a reason for hiding this comment

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

Clean refactor, much easier to follow the dockerBuild function now.

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.

Use input registry credentials during build to enable CacheFrom
2 participants