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

Add versions - pinniped-proxy #3452

Merged
merged 6 commits into from
Sep 21, 2021

Conversation

antgamdia
Copy link
Contributor

@antgamdia antgamdia commented Sep 20, 2021

Description of the change

This PR adds the --version command to pinniped-proxy

Benefits

Our binaries will properly display their version

Possible drawbacks

N/A

Applicable issues

Additional information

I have been also exploring vergen, but it gives us much more build/git/etc env information than we need.

IMAGE_TAG=dev make kubeapps/pinniped-proxy && docker run  docker.io/kubeapps/pinniped-proxy:dev   --version

Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Copy link
Contributor

@absoludity absoludity left a comment

Choose a reason for hiding this comment

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

Guessed you intended a different var name, but otherwise +1.

// If the binary is built with the ENV var "PINNIPED_PROXY_VERSION",
// the value will be available at buildime. Otherwise, it becomes "devel"
// We use this ENV var to display a custom version when passing the "-- version" flag
let foo = env::var("PINNIPED_PROXY_VERSION").unwrap_or("devel".to_string());
Copy link
Contributor

Choose a reason for hiding this comment

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

s/foo/version/ ?

And nice, hadn't read about bulid.rs - interesting interface to have for the build environment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, right.

It is really interesting (https://doc.rust-lang.org/cargo/reference/build-scripts.html), it seems to be very promising. I still have to take a closer look a the docs, just to see if there is something else we can leverage from.

Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
@antgamdia antgamdia merged commit a9ec3fc into vmware-tanzu:master Sep 21, 2021
@antgamdia antgamdia deleted the addVersion-pinnipedproxy branch September 21, 2021 16:26
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