Skip to content
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

Go import paths with typos are ignored by ko during release #1269

Closed
grantr opened this issue Aug 15, 2019 · 2 comments
Closed

Go import paths with typos are ignored by ko during release #1269

grantr opened this issue Aug 15, 2019 · 2 comments
Assignees

Comments

@grantr
Copy link
Contributor

grantr commented Aug 15, 2019

For the 0.8.1 release of eventing-contrib, some go import paths in YAML files were invalid due to typos (fixed in knative/eventing-contrib#543). ko resolve ignores any string that is not a valid go import path, so those strings were not recognized as buildable. The release succeeded, and some yaml files released were invalid (kafka-channel.yaml, kafka-channel-ccp.yaml).

Ideally tests would have caught this, and I'm not sure why they didn't (something else to investigate) but a simple safeguard might be to add a grep to release.sh that looks for ko-replaceable strings, e.g. image:\s+knative.dev or image:\s+github.com, and fails the release if they exist.

See ko-build/ko#9 for a more complete solution.

/cc @imjasonh @matzew

@adrcunha adrcunha self-assigned this Aug 15, 2019
@imjasonh
Copy link
Member

The underlying issue is fixed in ko-build/ko#58 which was just merged.

If you update your ko version (go get -u github.com/google/ko/cmd/ko) -- and expect/force developers to use a recent ko -- you can start prefixing expected import paths with ko:// and invoking ko resolve --strict -f config/.

This will cause ko to fail loudly if it finds an import path a human has marked but that it can't interpret as a valid Go main package.

@adrcunha
Copy link
Contributor

Current prow-tests image contains a ko version that includes the fix above:

https://storage.googleapis.com/knative-prow/logs/ci-knative-serving-continuous/1173630354808901632/build-log.txt

>> ko built from commit
b7eb9dfe48be3773c7d931208e8f6fec129acf07

Using ko:// paths is now safe for all jobs running on Prow.

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

No branches or pull requests

3 participants