You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Skaffold can build images where the image name in skaffold.yaml is a ko:// scheme-prefixed Go import path that may contain uppercase characters, e.g., ko://github.com/GoogleContainerTools/skaffold/cmd/skaffold.
This should work regardless of whether the Skaffold default repo is set or not.
Sanitization (see #4952) removes the ko:// prefix and lowercases the Go import path, e.g., ko://github.com/GoogleContainerTools/skaffold/cmd/skaffold -> github.com/googlecontainertools/skaffold/cmd/skaffold
Actual behavior
Builds of images with the ko:// prefix and Go import paths with uppercase characters fail if the Skaffold default repo is not set.
See steps to reproduce below for details on the error.
git clone https://github.com/GoogleContainerTools/skaffold.git
cd skaffold
git checkout v1.32.0
cd examples/custom
unset SKAFFOLD_DEFAULT_REPO
skaffold build --cache-artifacts=false --push=false
Output:
Generating tags...
- ko://github.com/GoogleContainerTools/skaffold/examples/custom -> ko://github.com/GoogleContainerTools/skaffold/examples/custom:latest
Starting build...
Building [ko://github.com/GoogleContainerTools/skaffold/examples/custom]...
2021/10/05 22:17:14 Using base gcr.io/distroless/static:nonroot for github.com/GoogleContainerTools/skaffold/examples/custom
2021/10/05 22:17:18 Building github.com/GoogleContainerTools/skaffold/examples/custom for linux/amd64
2021/10/05 22:17:18 Loading ko.local/github.com/googlecontainertools/skaffold/examples/custom:f3d25bf00e3dc061e3f130d284317c8599fcb80775418a559c0acfe9f98a6177
2021/10/05 22:17:18 Loaded ko.local/github.com/googlecontainertools/skaffold/examples/custom:f3d25bf00e3dc061e3f130d284317c8599fcb80775418a559c0acfe9f98a6177
Error parsing reference: "ko://github.com/GoogleContainerTools/skaffold/examples/custom:latest" is not a valid repository/tag: invalid reference format: repository name must be lowercase
exit status 1
This change ensures that image names from `skaffold.yaml` are sanitized
even when the Skaffold default repo is not set.
This is relevant for ko images with names that consist of the `ko://`
scheme prefixed, followed by a Go import path that may contain uppercase
characters, e.g.,
`ko://github.com/GoogleContainerTools/skaffold/cmd/skaffold`.
Fixes: GoogleContainerTools#6675
Tracking: GoogleContainerTools#6041
Related: GoogleContainerTools#4952
This change ensures that image names from `skaffold.yaml` are sanitized
even when the Skaffold default repo is not set.
This is relevant for ko images with names that consist of the `ko://`
scheme prefixed, followed by a Go import path that may contain uppercase
characters, e.g.,
`ko://github.com/GoogleContainerTools/skaffold/cmd/skaffold`.
Fixes: #6675
Tracking: #6041
Related: #4952
Expected behavior
Skaffold can build images where the image name in
skaffold.yaml
is ako://
scheme-prefixed Go import path that may contain uppercase characters, e.g.,ko://github.com/GoogleContainerTools/skaffold/cmd/skaffold
.This should work regardless of whether the Skaffold default repo is set or not.
Sanitization (see #4952) removes the
ko://
prefix and lowercases the Go import path, e.g.,ko://github.com/GoogleContainerTools/skaffold/cmd/skaffold
->github.com/googlecontainertools/skaffold/cmd/skaffold
Actual behavior
Builds of images with the
ko://
prefix and Go import paths with uppercase characters fail if the Skaffold default repo is not set.See steps to reproduce below for details on the error.
Information
Steps to reproduce the behavior
Output:
Related
This issue was uncovered by this failed build of #6614: https://github.com/GoogleContainerTools/skaffold/pull/6614/checks?check_run_id=3799415059
The text was updated successfully, but these errors were encountered: