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

Implement /api/v1/version for rekor-server #569

Merged
merged 2 commits into from
Dec 27, 2021

Conversation

Foxboron
Copy link
Contributor

Summary

This implements /api/v1/version and allows us to properly check what version rekor-server is currently running on a deployed instance.

Ticket Link

Fixes

Release Note


@dlorenc
Copy link
Member

dlorenc commented Dec 27, 2021

Nice! Let's see if GitHub is working again...

@Foxboron
Copy link
Contributor Author

Foxboron commented Dec 27, 2021

The only discussion point I believe is if the different LDFLAGS values really belong under pkg/api, or if we want pkg/version to contain them?

@dlorenc
Copy link
Member

dlorenc commented Dec 27, 2021

The only discussion point I believe is if the different LDFLAGS values really belong under pkg/api, or if we want pkg/version to contain them?

I don't mind much either way. The new debug/buildinfo stuff in go 1.18 will help out here in a few months when we can upgrade to it.

This implements a version endpoint for rekor. This helps figure out the
version the server is currently running. It could later be used to
implement version compatibility with CLI utilities.

Example:
   λ rekor main» curl -s localhost:3000/api/v1/version | jq
   {
     "builddate": "'2021-12-27T13:20:32Z'",
     "commit": "12d1a47c7ac986932a2734cb855c642ac01ffde4",
     "treestate": "dirty",
     "version": "v0.4.0-15-g12d1a47-dirty"
   }

This removes some duplication of the build flags and inserts them into
/pkg/api which is then reused across the utilities.

Signed-off-by: Morten Linderud <[email protected]>

Signed-off-by: Morten Linderud <[email protected]>
Signed-off-by: Morten Linderud <[email protected]>
@Foxboron
Copy link
Contributor Author

Fixed the missing license header. I can squash the commit with the generated swagger stuff if it's needed.

@dlorenc dlorenc merged commit 3f4129b into sigstore:main Dec 27, 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.

2 participants