Skip to content

Version Info is missing in controller #1553

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

Open
guettli opened this issue Mar 16, 2025 · 0 comments
Open

Version Info is missing in controller #1553

guettli opened this issue Mar 16, 2025 · 0 comments

Comments

@guettli
Copy link
Collaborator

guettli commented Mar 16, 2025

/kind bug

The version info string is empty:

"version":""

k logs -n mgt-system deployments/caph-controller-manager   | grep 'starting manager'

Found 4 pods, using pod/caph-controller-manager-5cbd64b89c-4cj8t
{"level":"INFO",...,"file":"./main.go:237","message":"starting manager","version":""}
k get -n mgt-system deployments.apps caph-controller-manager -o yaml | grep image:
        image: ghcr.io/syself/caph:v1.0.0

I think we should use: https://pkg.go.dev/runtime/debug#ReadBuildInfo instead of our current way (LDFLAGS := $(shell hack/version.sh))

Starting from Go 1.24 the BuildInfo will contain the git-commit.

When we use Go 1.24, we should remove our way of getting the git-version, and use something like that:

    bInfo, _ := debug.ReadBuildInfo()
    setupLog.Info("BuildInfo", "version", caphversion.Get().String(),
        "Main.Version", bInfo.Main.Version)
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

No branches or pull requests

1 participant