ko
ko copied to clipboard
Handle KO_DOCKER_REPO=ko.local/repo and --bare correctly
Fixes https://github.com/ko-build/ko/issues/807
cc @developer-guy
See comments in https://github.com/ko-build/ko/issues/807#issuecomment-1243695345 -- uniformly setting base: po.LocalDomain in NewDaemon was fine when we assumed/required that KO_DOCKER_REPO=ko.local would only be used without a repo, but we've since changed that assumption/requirement.
$ KO_DOCKER_REPO=ko.local/foo go run ./ build ./test --bare
...
ko.local/foo:3a28632fcb886b7a4c78be8cd36c34ec47e83f71ff55353e5602873400dca564
Note that this also handles ko.local/foo for other namers:
$ KO_DOCKER_REPO=ko.local/foo go run ./ build ./test --preserve-import-paths
...
ko.local/foo/github.com/google/ko/test:3a28632fcb886b7a4c78be8cd36c34ec47e83f71ff55353e5602873400dca564
KO_DOCKER_REPO=ko.local/foo go run ./ build ./test
...
ko.local/foo/test-46c4b272b3716c422d5ff6dfc7547fa9:3a28632fcb886b7a4c78be8cd36c34ec47e83f71ff55353e5602873400dca564
^ @eddycharly
:partying_face:
it would be good to release ko v0.13.0 that includes that fix ☝️