From dde76eb1722d44ab6a0f7c65782705153468a734 Mon Sep 17 00:00:00 2001 From: Halvard Skogsrud Date: Mon, 26 Jul 2021 16:57:21 +1000 Subject: [PATCH] Restore import path with uppercase characters I wasn't able to reproduce the issue described in #5492 and #5505, so this change restores the import path with the uppercase characters and the `ko://` prefix in the custom build example. I had to tweak some values to get the integration tests to run, because I don't have access to the `k8s-skaffold` project. Let's see if the build passes. Additional minor changes: - Bump the ko version in the custom build example. - Add the full path to the ko binary in the custom build script, in case `$GOPATH/bin` is not on the `PATH`. Once we move to Go 1.16 for our builds, we can use the `go install` command to install ko in the custom build shell script. --- integration/examples/custom/build.sh | 5 +++-- integration/examples/custom/skaffold.yaml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/integration/examples/custom/build.sh b/integration/examples/custom/build.sh index 97a2b585891..68e84828887 100755 --- a/integration/examples/custom/build.sh +++ b/integration/examples/custom/build.sh @@ -3,11 +3,12 @@ set -e if ! [ -x "$(command -v ko)" ]; then pushd $(mktemp -d) - go mod init tmp; GOFLAGS= go get github.com/google/ko/cmd/ko@v0.6.0 + curl -L https://github.com/google/ko/archive/v0.8.3.tar.gz | tar --strip-components 1 -zx + go build -o $(go env GOPATH)/bin/ko . popd fi -output=$(ko publish --local --preserve-import-paths --tags= . | tee) +output=$($(go env GOPATH)/bin/ko publish --local --preserve-import-paths --tags= . | tee) ref=$(echo "$output" | tail -n1) docker tag "$ref" "$IMAGE" diff --git a/integration/examples/custom/skaffold.yaml b/integration/examples/custom/skaffold.yaml index 3fe4ddade23..360aa426752 100644 --- a/integration/examples/custom/skaffold.yaml +++ b/integration/examples/custom/skaffold.yaml @@ -2,7 +2,7 @@ apiVersion: skaffold/v2beta21 kind: Config build: artifacts: - - image: github.com/googlecontainertools/skaffold/examples/custom + - image: ko://github.com/GoogleContainerTools/skaffold/examples/custom custom: buildCommand: ./build.sh dependencies: