-
Notifications
You must be signed in to change notification settings - Fork 164
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
Add flags to backfill script #2146
Conversation
Signed-off-by: Colleen Murphy <colleenmurphy@google.com>
Add options to the rekor client to set the minimum and maximum retry time, and make all rekor client options configurable for the backfill script. Signed-off-by: Colleen Murphy <colleenmurphy@google.com>
Add flags to the backfill script to allow passing custom headers to the Rekor service. The Rekor infrastructure may be configured to respond in certain ways to certain headers. Signed-off-by: Colleen Murphy <colleenmurphy@google.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2146 +/- ##
==========================================
+ Coverage 66.46% 68.11% +1.65%
==========================================
Files 92 92
Lines 9258 7308 -1950
==========================================
- Hits 6153 4978 -1175
+ Misses 2359 1591 -768
+ Partials 746 739 -7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -161,7 +188,12 @@ func main() { | |||
log.Fatalf("creating index client: %v", err) | |||
} | |||
|
|||
rekorClient, err := client.GetRekorClient(*rekorAddress, client.WithNoDisableKeepalive(true), client.WithRetryCount(10)) | |||
opts := []client.Option{client.WithNoDisableKeepalives(!*rekorDisableKeepalives)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bob had mentioned last time, but the double negatives are a bit confusing, especially since we negate the input. Do you think it would be cleaner to switch these to DisableKeepAlive
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried that on the first iteration of this PR, the problem is in GetRekorClient
, if we had this:
defaultTransport.DisableKeepAlives = o.DisableKeepalives
as opposed to conditioning on the negative, then if the option is unset it actually reverses the default behavior and several unit tests fail. The double negative helps distinguish whether the setting was unset or explicitly false.
Add retry options and make all configurable
Add options to the rekor client to set the minimum and maximum retry
time, and make all rekor client options configurable for the backfill
script.
Add ability to set custom headers in backfill
Add flags to the backfill script to allow passing custom headers to the
Rekor service. The Rekor infrastructure may be configured to respond
in certain ways to certain headers.
Summary
Release Note
Documentation