feat: add version command - #114
Merged
Merged
Conversation
This commit adds `kubectl version` command to datumctl and it configures goreleaser to correctly set the required variables. ``` ./dist/datumctl_linux_386_sse2/datumctl version Client Version: v0.10.1-SNAPSHOT-6d21716 Kustomize Version: v5.7.1 Server Version: v0.0.0-master+$Format:%H$ error: server version error: could not parse pre-release/metadata (-master+$Format:%H$) in version "v0.0.0-master+$Format:%H$" ``` As you can see kubectl fails as well so it looks something related to the server itself? ``` kubectl --kubeconfig .ninja/kubeconfig version Client Version: v1.34.3 Kustomize Version: v5.7.1 Server Version: v0.0.0-master+$Format:%H$ error: server version error: could not parse pre-release/metadata (-master+$Format:%H$) in version "v0.0.0-master+$Format:%H$" ```
Contributor
|
Thanks for reporting @gianarb! Created milo-os/milo#511 to chase this down in Milo. |
gianarb
enabled auto-merge
March 4, 2026 10:07
scotwells
approved these changes
Mar 4, 2026
scotwells
added a commit
to milo-os/milo
that referenced
this pull request
Aug 26, 2026
Fixes #511 ## Problem `kubectl version` and `datumctl version` fail against Milo and exit non-zero, because the API server serves a placeholder version string that neither can parse. Nobody can answer "which version are you running?" from the API, and `datumctl version` can't be used in a script or health check. ## What users get ```yaml # Before gitVersion: "v0.0.0-master+$Format:%H$" # kubectl: parse error, exit 1 gitCommit: "$Format:%H$" gitTreeState: "" buildDate: "1970-01-01T00:00:00Z" --- # After (image built from tag v0.32.5) gitVersion: "v1.35.0-milo.0.32.5+8f3a1c2" # valid semver gitCommit: "8f3a1c2e9d4b7a6f5c3e1d0b9a8f7e6d5c4b3a29" gitTreeState: "clean" buildDate: "2026-08-26T14:02:11Z" ``` `gitVersion` reports the Kubernetes API level Milo implements and carries the Milo release in the pre-release segment. It can't simply be `v0.32.5`: the API server parses this field to derive its feature-gate version, and Milo's major-0 tags fail that validation — the obvious fix works on branch builds and breaks the server on the next tagged release. `milo version` reports the Milo release on its own line, and `-o json|yaml` gains a `miloVersion` field. The `.dockerignore` change is unrelated to the version fix — a stale local `vendor/` tree otherwise fails the build. Happy to drop it. ## Testing `task test:unit` passes. Release-tag rehearsal (`docker build --build-arg VERSION=v0.32.5`) produces a correct version and an API server that starts — the regression that would otherwise surface only at release time. Follow-up: `datumctl` can surface the Milo release from the `milo.<version>` segment — see datum-cloud/datumctl#114.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit adds
kubectl versioncommand to datumctl and it configuresgoreleaser to correctly set the required variables.
As you can see kubectl fails as well so it looks something related to
the server itself?