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: show real version in k8sgpt version command #430

Closed
wants to merge 1 commit into from

Conversation

panpan0000
Copy link
Contributor

@panpan0000 panpan0000 commented May 17, 2023

Closes # NA

so far , k8sgpt version always show dev

📑 Description

when make , a version.md will show up, then using golang embed to load it.

test result:

./bin/k8sgpt version
k8sgpt version v0.3.2

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

@panpan0000 panpan0000 requested review from a team as code owners May 17, 2023 04:46
@panpan0000 panpan0000 changed the title chore: show real version in k8sgpt version command fix: show real version in k8sgpt version command May 17, 2023
Signed-off-by: Peter Pan <Peter.Pan@daocloud.io>
@AlexsJones
Copy link
Member

Thanks for the suggestion, but it only shows dev when you are working from the codebase.

The builds all have the version as part of their build information.

https://github.com/k8sgpt-ai/k8sgpt/blob/main/Makefile#L86

Thank you for the suggestion though!

@AlexsJones AlexsJones closed this May 17, 2023
@panpan0000
Copy link
Contributor Author

panpan0000 commented May 17, 2023

Hi, @AlexsJones

A pity that the code you shown is not working.

# docker run ghcr.io/k8sgpt-ai/k8sgpt:v0.3.2  version
k8sgpt version dev

# docker run ghcr.io/k8sgpt-ai/k8sgpt:v0.3.1  version
k8sgpt version dev

from the code, the k8sgpt version command return should always come from string in main.go:

var version = "dev"

But the magic is the binaries and packages downloaded from https://github.com/k8sgpt-ai/k8sgpt/releases are good !!
they will show 0.3.2 correctly !

I don't understand how the magic happens !! woo~~~

wget https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.3.2/k8sgpt_Linux_x86_64.tar.gz
tar -zxvf k8sgpt_Linux_x86_64.tar.gz
./k8sgpt version
k8sgpt version 0.3.2

@AlexsJones
Copy link
Member

Thanks for raising this bug for the docker image, ill create an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants