--label argument does not support strings with spaces
Actual behavior Use --label="test string" and builds fail
Expected behavior Build proceeds normally
To Reproduce Steps to reproduce the behavior:
- Add --label="test string" to as an argument
Hey @zanechua label argument expects key=value format
--label key=value
Could you share your fail message it might be because of that
/kaniko/executor --context /builds/app/backend --dockerfile /builds/app/backend/Dockerfile --label com.gitlab.ci.user='Zane J. Chua'
Error: unknown command "J." for "executor"
I experience the same issue. @zanechua did you find a workaround?
Hi! Any updates ? I'm having the same issue.
I fail to reproduce this:
$ echo 'FROM scratch' > Dockerfile
$ docker run -it --rm \
> -v $(pwd):/app \
> -v /var/run/docker.sock:/var/run/docker.sock \
> --workdir /app \
> gcr.io/kaniko-project/executor \
> --tarPath /app/image.tar \
> --destination=test \
> --no-push \
> --label com.gitlab.ci.user="Zane J. Chua"
INFO[0000] No base image, nothing to extract
INFO[0000] Built cross stage deps: map[]
INFO[0000] No base image, nothing to extract
INFO[0000] Executing 0 build triggers
INFO[0000] Skipping unpacking as no commands require it.
INFO[0000] Skipping push to container registry due to --no-push flag
$ tar xvf image.tar "sha256:*"
x sha256:d0e7ffca64af8ab82c7bd367e65ffd2096872f12fa2c869dd1a601ba71938251
$ cat sha256:d0e7ffca64af8ab82c7bd367e65ffd2096872f12fa2c869dd1a601ba71938251 |jq -r '.config.Labels."com.gitlab.ci.user"'
Zane J. Chua
Any idea how this test differs from the issue the users issue ?
Maybe someone faced similar issue like this:
Error: unknown command " --label 'key'='value'" for "executor"
I solved this issue by passing --label flag right after --context flag:
/kaniko/executor --cache=${IMAGE_CACHE} --context ${CONTEXT} ${LABELS} ${BUILD_ARGS}...
Any idea how this test differs from the issue the users issue ?
On my end it also works with the --no-push option, but only when pushing to somewhere the error occurs.
I experience the same issue.
It is related to https://github.com/GoogleContainerTools/kaniko/issues/1803 but there's a twist: spaces are not a problem, also . characters are not a problem in my case. However, an odd number of ' (single quote) characters in the label value results in an error:
unexpected end of statement while looking for matching single-quote
Just as in https://github.com/GoogleContainerTools/kaniko/issues/1803, the error only appears when --cache is enabled.