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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failure to pull private packages due to URI scheme #2939

Merged
merged 3 commits into from Mar 4, 2022

Conversation

hasheddan
Copy link
Member

@hasheddan hasheddan commented Mar 4, 2022

Description of your changes

Fixes an issue with matching package pull secrets during registry authentication when auth data included a URI scheme (google/go-containerregistry#1299). Also, moves away from using the LayerFromReader function, which is now deprecated (due to issues with reading entire content into memory), but we opt to essentially replicate the previous behavior since we are currently only using it in tests and building packages with CLI (the latter of which we can optimize in the future, but have not here to keep the fix targeted).

Fixes #2876

xref:

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

Worked with @mcbenjemaa to verify that the issue with installing from artifact registry is now fixed, and also verified successful package install in my local environment.

Also validated that packages still build correctly with the LayerFromOpener change:

馃 (crossplane) go run ./cmd/crank/ build configuration -f ./docs/snippets/package/aws/.
馃 (crossplane) ls ./docs/snippets/package/aws
composition.yaml  crossplane.yaml  definition.yaml  getting-started-with-aws-6acb3f709c6c.xpkg

Updates to latest go-containerregistry including the k8schain and
kubernetes auth submodules to fix the issue of not picking up matching
pull secrets that use URI schemes.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
Moves from using the LayerFromReader to LayerFromOpener as the former
is now deprecated. The same beahvior is reflected, which we are okay
with using in the context of unit tests.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
LayerFromReader is now deprecated, but we opt to keep the same
functionality for the time-being, instead of moving to buffering through
a temp file. TODO is added indicating that we can optimize this path in
the future, but it is currently only used for building using the CLI.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
@mcbenjemaa
Copy link
Member

mcbenjemaa commented Mar 4, 2022

LGTM

@github-actions
Copy link

github-actions bot commented Mar 4, 2022

Successfully created backport PR #2941 for release-1.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

packagePullSecrets not working on v1.6.2
3 participants