-
Notifications
You must be signed in to change notification settings - Fork 706
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
Add versions - pinniped-proxy #3452
Conversation
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>
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.
Guessed you intended a different var name, but otherwise +1.
cmd/pinniped-proxy/build.rs
Outdated
// 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()); |
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.
s/foo/version/ ?
And nice, hadn't read about bulid.rs
- interesting interface to have for the build environment.
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.
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>
Description of the change
This PR adds the
--version
command topinniped-proxy
Benefits
Our binaries will properly display their version
Possible drawbacks
N/A
Applicable issues
--version
to all of our binaries #3429Additional information
I have been also exploring vergen, but it gives us much more build/git/etc env information than we need.