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

Allow overriding remote options #3049

Merged
merged 1 commit into from Jun 13, 2023
Merged

Conversation

jonjohnsonjr
Copy link
Contributor

RegistryOptions.GetRegistryClientOpts is used in a bunch of places, and it always instantiates a new set of options. This is ~fine for callers that only use the options once (e.g. the cosign CLI), but is unfortunate for callers that would like to reuse those options.

It's useful to reuse these options because they represent a shared context that eliminates a lot of duplicate work across calls (e.g. authenticating with the registry and doing existence checks).

RegistryOptions.GetRegistryClientOpts is used in a bunch of places, and
it always instantiates a new set of options. This is ~fine for callers
that only use the options once (e.g. the cosign CLI), but is unfortunate
for callers that would like to reuse those options.

It's useful to reuse these options because they represent a shared
context that eliminates a lot of duplicate work across calls
(e.g. authenticating with the registry and doing existence checks).

Signed-off-by: Jon Johnson <jon.johnson@chainguard.dev>
@codecov
Copy link

codecov bot commented Jun 12, 2023

Codecov Report

Merging #3049 (47139ca) into main (1660de7) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #3049      +/-   ##
==========================================
- Coverage   31.08%   31.06%   -0.02%     
==========================================
  Files         155      155              
  Lines        9739     9744       +5     
==========================================
  Hits         3027     3027              
- Misses       6250     6255       +5     
  Partials      462      462              
Impacted Files Coverage Δ
cmd/cosign/cli/options/registry.go 0.00% <0.00%> (ø)

Copy link
Contributor

@hectorj2f hectorj2f left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

thanks

@cpanato cpanato merged commit 86da4aa into sigstore:main Jun 13, 2023
26 checks passed
@github-actions github-actions bot added this to the v1.14.0 milestone Jun 13, 2023
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

3 participants