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

fix: fix fallback to Git tag if VCS is unavailable #530

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

maxbrunet
Copy link
Contributor

When version is unavailable from the VCS, build info always returns (devel) as version

Tested without .git directory:

$ make kubelogin GIT_TAG=v0.1.4
rm -f bin/darwin_arm64/kubelogin
CGO_ENABLED=0 go build -o bin/darwin_arm64/kubelogin -ldflags "-X main.gitTag=v0.1.4"

$ "bin/$(go env GOOS)_$(go env GOARCH)/kubelogin" --version
kubelogin version
git hash: v0.1.4
Go version: go1.23.1
Build time: unknown
Platform: darwin/arm64

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 65.70%. Comparing base (cabc5a9) to head (00148d4).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
version.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #530      +/-   ##
==========================================
- Coverage   65.90%   65.70%   -0.20%     
==========================================
  Files          29       29              
  Lines        2050     2050              
==========================================
- Hits         1351     1347       -4     
- Misses        626      629       +3     
- Partials       73       74       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@weinong
Copy link
Contributor

weinong commented Oct 7, 2024

documenting what it looks like when vcs is not present

./bin/linux_amd64/kubelogin --version
kubelogin version
git hash: (devel)
Go version: go1.21.11
Build time: unknown
Platform: linux/amd64

Copy link
Contributor

@weinong weinong left a comment

Choose a reason for hiding this comment

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

LGTM

@weinong weinong merged commit ae4b42a into Azure:main Oct 7, 2024
6 checks passed
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