-
Notifications
You must be signed in to change notification settings - Fork 405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding "main:" to .ko.yaml causes build to succeed with missing environment variables #483
Comments
cc @HeavyWombat in case he knows what might be causing this |
I think that's the case, yeah. I've tested this with the So I think In the docs for goreleaser (whose config we're borrowing from here) it says:
So it sounds like this is supposed to be a file path, and not a full Go importpath. I wonder if we could detect the importpath case and fail with a better descriptive error message, instead of just silently proceeding. 🤔 |
Presumably, this could be a general check that just verifies that the specified directory or file actually exists; that would have caught my mistake. I don't think it has to be an import path specific case (since reasonably I could write Though, I don't exactly know how this led to the environment variable not working! |
Sorry for the late reply. I will have a look, too. If I am not mistaken, both the |
Had a look now and I totally misunderstood the issue in the beginning. With My two key takeaways here are:
|
I'm not sure I follow on the first point. The error message is fine when it works ( |
* Add build config usage log statement There is currently no indication whether `ko` picks one of the configured build configurations from the `.ko.yaml` configuration file for a build. Add log statement to print the build config being picked for the build. Introduce default entry for build config `ID` in case it is not specified. * Add path check for build configuration settings Add `os.Stat` to verify that the path that is configured in the build configuration entry is valid. As a side effect, this will print out an error message in case someone sets an import path like `github.com/google/ko` in the `main` field of the build config. * Fix trimpath command line flag in README Fixed wrong command line flag `--trimpath` to `-trimpath`.
This is a re-report from reddit.
I have this as my config:
When I run ko, I get an error as expected:
But, change the config to this (adding
main:
):And now it builds, ignoring the missing variable:
Adding
main: .
doesn't hit this (presumably because it's the default).Perhaps it's intended to be an error to specify a full path?
The text was updated successfully, but these errors were encountered: