Comments (11)
@nmittler possibly related to some of your recent go flag changes? Can you take a look?
from ko.
To repro use the env-var
export KO_FLAGS="--platform=linux/amd64"
from ko.
Yeah git bisect shows
2a4c12f410f678ee72c2dcd8036ceb1b9b113c10 is the first bad commit
commit 2a4c12f410f678ee72c2dcd8036ceb1b9b113c10
Author: Nathan Mittler <[email protected]>
Date: Wed May 15 13:16:12 2024 -0700
Add global flags and ldflags
Fixes #1304
docs/configuration.md | 25 ++++++++++++++
pkg/build/gobuild.go | 50 ++++++++++++++++++---------
pkg/build/gobuild_test.go | 49 ++++++++++++++++++++++++++
pkg/build/options.go | 16 +++++++++
pkg/commands/options/build.go | 20 ++++++++---
pkg/commands/options/build_test.go | 23 +++++++++---
pkg/commands/options/testdata/config/.ko.yaml | 5 +++
pkg/commands/resolver.go | 2 ++
8 files changed, 165 insertions(+), 25 deletions(-)
bisect found first bad commit
from ko.
hmm ... possibly #1314? In pkg/commands/options/build.go
I added v.GetStringSlice("flags")
. Not sure if this is interacting with KO_FLAGS
?
from ko.
Actually .. is KO_FLAGS
even an environment variable that ko previously supported? Maybe a viper thing?
from ko.
from ko.
Unfortunately, I'm definitely not a viper expert :). I'm guessing that <EnvPrefix>_FLAGS
is a default variable exposed and used by viper, but I don't see it mentioned in the docs. Any links on how this works?
from ko.
Actually sorry I made a mistake - KO_FLAGS
is not a ko
thing. I guess in your commit you're now reading it for some reason.
from ko.
I guess when you added that GetStringSlice it prepends KO
in front of the envvar - https://github.com/ko-build/ko/blame/bb99eccfe235e7b583c857bb1bafbf45f72178d1/pkg/commands/options/build.go#L112
from ko.
maybe you should rename the flag? eg. go_flags
or something? Then it can be set using KO_GO_FLAGS
likewise with the ldflags
- since those are go build
specific
from ko.
@dprotaso yeah, that's was my thought as well. Will send a PR shortly.
from ko.
Related Issues (20)
- The default value for --platform is not documented HOT 1
- ko build does not give me a way to put annotations in a multi-platform manifest HOT 1
- how to specify build tag when doing "ko build" to avoid build constraint error
- ko sbom binding strategy problem HOT 2
- Pushing to ECR without logging in first doesn't work HOT 3
- Support setting capabilities on the app binary HOT 2
- feature request: make it possible to set the WORKDIR HOT 2
- Missing SBOM image in image-refs file HOT 1
- Question: set argv parameters for the built binaries? HOT 1
- Support local images with custom image name HOT 1
- feat: Add platform template parameters HOT 1
- feat: Add global ldflags
- feat: Add global env
- feat: Add git template variables HOT 1
- [Docs] Broken link to `builds` section
- docs: ko does not works without -bare option for ECR HOT 1
- docs: image creation not 1970
- sbom handling deprecated?
- Allow specifying multiple builds that reference the same dir/main, then specify which build ID when running ko build
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ko.