-
Notifications
You must be signed in to change notification settings - Fork 165
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 sharding package and update validators #583
Conversation
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.
lgtm
pkg/sharding/sharding.go
Outdated
UUID: uuid}, nil | ||
} | ||
|
||
func CreateEmptyFullID() FullID { |
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.
is this intent for this to be public or just a internal helper function?
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.
Good catch, I'm still getting used to go's use of caps to mean public. I suppose for now it should be internal so I'll update it.
cmd/rekor-cli/app/pflags.go
Outdated
IDStringValidatorFunc := validateString("required,hexadecimal") | ||
IDErr := IDStringValidatorFunc(v) | ||
|
||
if IDErr != nil { |
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.
IDStringValidatorFunc := validateString("required,hexadecimal") | |
IDErr := IDStringValidatorFunc(v) | |
if IDErr != nil { | |
if err := validateString("required,hexadecimal")(v); err != nil { |
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.
Nice, thank you! I'm making this change.
Signed-off-by: Lily Sturmann <[email protected]>
A FullID is a UUID prepended by a TreeID. This will be used for log sharding Signed-off-by: Lily Sturmann <[email protected]>
Thanks for the helpful comments, @bobcallaway . I've made some updates. Also I'm not sure what we should call the |
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.
lgtm, thanks!
|
Nice job! |
Summary
Commit 1: Add sharding package. I moved this to
pkg/
so it can be accessed by both the server and cli as needed, but if this is no the right place, I can move it.Commit 2: Update UUID validators to accept both current 64-char UUID and longer 80-char FullID defined in sharding package.
Ticket Link
Related to #487
(More work to be done before the issue is closed)