Skip to content

fix(understackctl): make version stamping actually work - #2192

Merged
cardoe merged 1 commit into
mainfrom
understackctl-build-fixes
Aug 17, 2026
Merged

fix(understackctl): make version stamping actually work#2192
cardoe merged 1 commit into
mainfrom
understackctl-build-fixes

Conversation

@cardoe

@cardoe cardoe commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

The Makefile has always built LDFLAGS with -X main.version and
-X main.commit, but neither variable existed and nothing exposed a
--version flag. build-all also expanded $() instead of $(LDFLAGS).
Declare both variables, wire them into understackctl --version.

@cardoe
cardoe requested a review from a team August 5, 2026 04:23
@geetikabatra

geetikabatra commented Aug 5, 2026

Copy link
Copy Markdown

LGTM by looking at the code. I haven't tried the ctl manually myself on my laptop. Is there a definitive guide which I could follow to test this myself? Would I require a dev setup of understack in my local to test this?

@cardoe

cardoe commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

LDTM by looking at the code. I haven't tried the ctl manually myself on my laptop. Is there a definitive guide which I could follow to test this myself? Would I require a dev setup of understack in my local to test this?

https://rackerlabs.github.io/understack/operator-guide/understackctl/

@cardoe
cardoe enabled auto-merge August 5, 2026 23:48
The Makefile has always built LDFLAGS with -X main.version and
-X main.commit, but neither variable existed and nothing exposed a
--version flag. build-all also expanded $() instead of $(LDFLAGS).
Declare both variables, wire them into `understackctl --version`.
@cardoe
cardoe force-pushed the understackctl-build-fixes branch from ca6bbb3 to d6effa3 Compare August 10, 2026 19:36
@geetikabatra

geetikabatra commented Aug 16, 2026

Copy link
Copy Markdown

I thought we decided to sepearate version change and the change in the MAKEFILE separate.

@cardoe

cardoe commented Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

I thought we decided to sepearate version change and the change in the MAKEFILE separate.

One doesn't work without the other. There's no way to test them. You need to have LDFLAGS passed along to get the version info passed in.

@geetikabatra

geetikabatra commented Aug 17, 2026

Copy link
Copy Markdown

I get it now, I had a gap in my knowledge here. It is clear to me now. I faintly remember that LDFLAGS were used in other projects, but you have defined it earlier in MAKEFILE which has the keyword version in it. Hence the confusion. Since above line was earlier added at some other epoch of time. I could not relate to it.
A quick suggestion, if code for setting version was part of go build command earlier, the LDFLAGS variable shouldn't have incorporated it. It should have been in this PR. This helps reduce redundancy and miscomprehension of code.

@cardoe

cardoe commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

I'm not sure what you're looking for me to change code wise. Will you just make the change?

@geetikabatra

Copy link
Copy Markdown

It looks good to me. No change is required.

@cardoe

cardoe commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

It looks good to me. No change is required.

Okay. Will you approve the PR then?

@cardoe
cardoe added this pull request to the merge queue Aug 17, 2026
@geetikabatra

Copy link
Copy Markdown

Done!

Merged via the queue into main with commit 6a7b558 Aug 17, 2026
25 checks passed
@cardoe
cardoe deleted the understackctl-build-fixes branch August 17, 2026 12:07
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