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

Do not check /v2 endpoint on registry when RoundTripper is provided #1396

Merged
merged 2 commits into from
Jun 27, 2022

Conversation

joaopapereira
Copy link
Contributor

This PR contains the following changes:

  1. Bump staticcheck to the latest version and fix problems detected.
  2. When a RoundTripper of the type transport.Wrapper is provided to the function NewWithContext, the function will assume that the called has already created the RoundTripper and made sure that the authentication happened and that the registry supports V2 of distribution spec.

Refactor tests that where Marshalling the transport.Error. This was
causing staticcheck to fail.
Instead of trying to Marshall the error we now provide the strings
version of the expected errors.

Signed-off-by: João Pereira <joaod@vmware.com>
When the calling the function NewWithContext, if the RoundTripper
provided is of the type transport.Wrapper, the function will assume that
the caller did the needed due diligence to ensure the registry supports
OCI v2. In this case the function will only need to return back the
provided RoundTripper without any further change.

Signed-off-by: João Pereira <joaod@vmware.com>
@jonjohnsonjr
Copy link
Collaborator

Thanks! Do you mind splitting the staticcheck stuff out into a separate PR just so it's easier to revert the roundtripper change if we need to?

@joaopapereira
Copy link
Contributor Author

I added the change in 2 separate commits, do you think that is enough or will you want the ability to roll back the PR to make it more trackable?

@jonjohnsonjr
Copy link
Collaborator

Ah the two separate commits is fine!

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.

None yet

2 participants