fix(build): stamp ko images via .ko.yaml, drop unsupported ko --ldflags#163
Closed
Davanum Srinivas (dims) wants to merge 1 commit into
Closed
fix(build): stamp ko images via .ko.yaml, drop unsupported ko --ldflags#163Davanum Srinivas (dims) wants to merge 1 commit into
Davanum Srinivas (dims) wants to merge 1 commit into
Conversation
ko build has no --ldflags flag (only ko run/delete tolerate unknown
flags), so `make build-images` and `make build-demos` aborted with
"unknown flag: --ldflags". It went unnoticed because no CI workflow runs
`make build*`: e2e installs via hack/install-ate.sh, which builds images
with `ko apply`/`ko resolve`. Only the plain go-build targets (kubectl-ate,
atenet) actually stamped anything.
Move image stamping to ko's supported mechanism -- defaultLdflags in .ko.yaml
with git/date templating. This also stamps the ko apply/resolve install path,
with no env wiring. Version uses {{.Git.ShortCommit}} because no release tag
is reachable from HEAD ({{.Git.Tag}} would emit a misleading "v0.0.0"). The
go-built CLI binaries keep `go build -ldflags "$(LDFLAGS)"` unchanged.
Verified: ko-built ateapi image runs as
4cbac18 commit=4cbac189030646eb30644664798232a7cba70c64 built=... linux/arm64
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
Collaborator
|
compare to #162 ? |
Collaborator
Author
|
Tim Hockin (@thockin) beat me to it! #162 |
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.
UGH! i made a mistake.. ko build has no --ldflags flag (only ko run/delete tolerate unknown flags), so
make build-imagesandmake build-demosaborted with "unknown flag: --ldflags". It went unnoticed because no CI workflow runsmake build*: e2e installs via hack/install-ate.sh, which builds images withko apply/ko resolve. Only the plain go-build targets (kubectl-ate, atenet) actually stamped anything.Fixes #<issue_number_goes_here>