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

Reuse transport when talking with registries #334

Merged
merged 1 commit into from
Feb 24, 2022

Conversation

joaopapereira
Copy link
Member

This PR adds makes an improvement on the communication with the registries. Previously for each request done to the registry, a new transport was created. The main issue is that the authentication part was lost between requests.
We are introducing a store that will maintain the transport information that will be reused whenever possible, this will lower the number of times that imgpkg needs to talk with authentication servers.

@joaopapereira joaopapereira temporarily deployed to TanzuNet Registry Dev e2e February 16, 2022 18:14 Inactive
@joaopapereira joaopapereira temporarily deployed to GCR e2e February 16, 2022 18:14 Inactive
@joaopapereira joaopapereira force-pushed the multiple-auth-requests-imgpkg branch from 24e6fda to c54ded9 Compare February 23, 2022 18:18
@joaopapereira joaopapereira temporarily deployed to GCR e2e February 23, 2022 18:18 Inactive
@joaopapereira joaopapereira temporarily deployed to TanzuNet Registry Dev e2e February 23, 2022 18:18 Inactive
pkg/imgpkg/registry/transport.go Outdated Show resolved Hide resolved
pkg/imgpkg/registry/transport.go Show resolved Hide resolved
pkg/imgpkg/registry/transport.go Outdated Show resolved Hide resolved
pkg/imgpkg/registry/transport.go Show resolved Hide resolved
pkg/imgpkg/registry/registry.go Show resolved Hide resolved
By reusing the same transport when talking to the registries imgpkg
doesn't need to retrieve the oauth token everytime a request is made to
the registry

Signed-off-by: Joao Pereira <[email protected]>
@joaopapereira joaopapereira force-pushed the multiple-auth-requests-imgpkg branch from c54ded9 to df3f7f0 Compare February 24, 2022 17:24
@joaopapereira joaopapereira temporarily deployed to TanzuNet Registry Dev e2e February 24, 2022 17:24 Inactive
@joaopapereira joaopapereira temporarily deployed to GCR e2e February 24, 2022 17:24 Inactive
@cppforlife
Copy link
Contributor

lgtm

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.

3 participants