Skip to content

feat: add version command - #114

Merged
gianarb merged 1 commit into
mainfrom
feat/add-version-command
Mar 4, 2026
Merged

gianarb merged 1 commit into
mainfrom
feat/add-version-command

Conversation

@gianarb

@gianarb gianarb commented Mar 2, 2026

Copy link
Copy Markdown
Collaborator

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$"

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$"
```
@gianarb
gianarb requested a review from scotwells March 2, 2026 15:12
@cla-assistant

cla-assistant Bot commented Mar 2, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@scotwells

Copy link
Copy Markdown
Contributor

Thanks for reporting @gianarb! Created milo-os/milo#511 to chase this down in Milo.

@gianarb
gianarb enabled auto-merge March 4, 2026 10:07
@gianarb
gianarb merged commit b6d30da into main Mar 4, 2026
3 checks passed
@gianarb
gianarb deleted the feat/add-version-command branch March 4, 2026 14:49
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.
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.

2 participants