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

Enable JSON format for search command #438

Merged
merged 1 commit into from
Sep 19, 2021

Conversation

luhring
Copy link
Contributor

@luhring luhring commented Sep 19, 2021

Summary

I noticed that there was an inconsistency in the output for the rekor-cli search command between the default format and the JSON format:

$ rekor-cli search --email dan.luhring@anchore.com              
Found matching entries (listed by UUID):
30c398a619c5eb00856bc41df6ab4c660e321ed06e745b562947c48e0dc5ef64
$ rekor-cli search --email dan.luhring@anchore.com --format json
Found matching entries (listed by UUID):
{}

Diagnosis: The searchCmdOutput struct wasn't able to be marshaled because its field uuids wasn't exported. This PR exports that field.

Testing

Run the search command and specify the JSON format:

$ go run ./cmd/rekor-cli/main.go search --email dan.luhring@anchore.com --format json                   

See that the JSON output has the UUIDs field populated correctly:

Found matching entries (listed by UUID):
{"UUIDs":["30c398a619c5eb00856bc41df6ab4c660e321ed06e745b562947c48e0dc5ef64"]}

Ticket Link

(n/a)

Release Note

Enable JSON format for search command

Signed-off-by: Dan Luhring dan.luhring@anchore.com

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
@dlorenc
Copy link
Member

dlorenc commented Sep 19, 2021

Great catch!

@dlorenc dlorenc merged commit c519868 into sigstore:main Sep 19, 2021
@cpanato cpanato added this to the v1.0.0 milestone Sep 20, 2021
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.

3 participants