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 version flag to host agent #346

Merged
merged 1 commit into from
Jan 25, 2022
Merged

Add version flag to host agent #346

merged 1 commit into from
Jan 25, 2022

Conversation

raunaksingwi
Copy link
Contributor

What this PR does / why we need it:
Add version flag to the host agent so that the user can know the version being used.
The output shows the version of the binary and the time it was built.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #278

Additional information
Used ldflags to embed the version number and time at build time in the binary.

The version number has to be passed as a variable to the Makefile. It will be passed by the GH action while the build is triggered.
When the version is not passed, it takes the default as "dev"

anusha94
anusha94 previously approved these changes Jan 24, 2022
Copy link
Contributor

@anusha94 anusha94 left a comment

Choose a reason for hiding this comment

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

lgtm

@raunaksingwi raunaksingwi enabled auto-merge (squash) January 24, 2022 10:44
Copy link
Contributor

@dharmjit dharmjit left a comment

Choose a reason for hiding this comment

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

IMO, we need a consistent organization for HostAgent flags related code. Currently some of the code(help, labels flag) is inside main package and this PR introduces a new package version. How could we make it more cleaner? thoughts @anusha94 @raunaksingwi @huchen2021

agent/version/version_test.go Show resolved Hide resolved
Add version flag to the host agent so that the user can know the version being used.
The output shows the version of the binary and the time it was built.
@anusha94
Copy link
Contributor

IMO, we need a consistent organization for HostAgent flags related code. Currently some of the code(help, labels flag) is inside main package and this PR introduces a new package version. How could we make it more cleaner? thoughts @anusha94 @raunaksingwi @huchen2021

Agreed. All flags are all over the place now. @raunaksingwi Mind creating a new issue to address this so that this PR is unblocked?

Copy link
Contributor

@dharmjit dharmjit left a comment

Choose a reason for hiding this comment

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

lgtm

@raunaksingwi raunaksingwi merged commit edba0db into vmware-tanzu:main Jan 25, 2022
@raunaksingwi raunaksingwi deleted the add-version-flag branch January 25, 2022 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add --version flag to host agent binary
4 participants