Skip to content

Commit

Permalink
Restore import path with uppercase characters
Browse files Browse the repository at this point in the history
I wasn't able to reproduce the issue described in GoogleContainerTools#5492 and GoogleContainerTools#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.
  • Loading branch information
halvards authored and tejal29 committed Aug 11, 2021
1 parent 73d1ec9 commit dde76eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions integration/examples/custom/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion integration/examples/custom/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit dde76eb

Please sign in to comment.