feat(nodeadm): support for nodeadm version display#2321
feat(nodeadm): support for nodeadm version display#2321guessi wants to merge 2 commits intoawslabs:mainfrom
Conversation
ed80709 to
8dfbd18
Compare
|
Notice merge conflicts, let me fix it. |
8dfbd18 to
6534ca0
Compare
Test after rebasedWith no tag% make build
GOOS= go build -ldflags="-X 'main.gitTagVersion=v20250715-6-g6534ca01'" -o <redacted>/_bin/ ./cmd/...% ./_bin/nodeadm --version
Version: v20250715-6-g6534ca01With tag (for test only, not actually a release)% git tag v20250717
% git describe --exact-match --tags
v20250717% make build
GOOS= go build -ldflags="-X 'main.gitTagVersion=v20250717'" -o <redacted>/_bin/ ./cmd/...% ./_bin/nodeadm --version
Version: v20250717 |
nodeadm/Makefile
Outdated
| endif | ||
|
|
||
| # Version from git tags | ||
| VERSION ?= $(shell git describe --tags --abbrev=8 --always) |
There was a problem hiding this comment.
Unfortunately, this won't work with our current setup. The nodeadm build happens in a container as a part of the AMI build, and there is no .git directory in that workspace. Additionally, the git tag for an release does not actually exist when the AMI build happens. We could wire something up, but it would have to happen in our internal release tooling.
We could do this as a pre-req without changing behavior, and then set the version in a future release:
| VERSION ?= $(shell git describe --tags --abbrev=8 --always) | |
| VERSION ?= 0.0.0 |
There was a problem hiding this comment.
Umm... interesting, sounds like we need somethings like sed/awk/...
Never mind, I just made updates, and I can see could be done by...
% VERSION=1.2.3 make build
GOOS= go build -ldflags="-X 'main.version=1.2.3'" -o <redacted>/_bin/ ./cmd/...`% ./_bin/nodeadm --version
Version: 1.2.3There was a problem hiding this comment.
Yeah exactly, we can pass the correct version with our internal tooling
6534ca0 to
8caa01d
Compare
|
Just made an update to support both % VERSION=v1.99.88 make build% ./_bin/nodeadm --version
Version: v1.99.88% ./_bin/nodeadm-internal --version
Version: v1.99.88 |
|
This pull request is stale because it has been open for 60 days with no activity. Remove the stale label or comment to avoid closure in 14 days |
Issue #, if available:
Description of changes:
By current design, there have no version support for
nodeadm, so it would inherit the setup fromintegrii/flaggyWith this PR change, not only make it possible to identify which version it is about, but also help customer to identify which
nodeadmit is running with.Cross ref: aws/eks-hybrid#639 and aws/eks-hybrid#640
Testing Done
Before change:
$ /usr/bin/nodeadm version Version: 0.0.0After change:
$ ./_bin/nodeadm --version Version: v20250627-7-ged80709a