Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kaniko fails on empty argument with quotes in Dockerfile after 5bbb40e #847

Closed
denis111 opened this issue Nov 8, 2019 · 0 comments · Fixed by #850
Closed

Kaniko fails on empty argument with quotes in Dockerfile after 5bbb40e #847

denis111 opened this issue Nov 8, 2019 · 0 comments · Fixed by #850
Assignees
Labels
area/behavior all bugs related to kaniko behavior like running in as root kind/bug Something isn't working

Comments

@denis111
Copy link

denis111 commented Nov 8, 2019

Actual behavior
Kaniko fails on empty argument with quotes in Dockerfile like:
ARG VARIANT=""
and also empty --build-arg VARIANT=

Expected behavior
Build Dockerfile

To Reproduce
Steps to reproduce the behavior:

  1. Use the latest kaniko image.
  2. Create Dockerfile with any empty argument but with quotes.

Additional Information

  • Dockerfile
    ARG VARIANT=""
    ARG VERSION=2
    FROM registry.example.com/image${VARIANT}:${VERSION}

  • Build Context

  • Kaniko Image (fully qualified with digest)
    any image after 5bbb40e commit

Triage Notes for the Maintainers

It didn't happen before 5bbb40e commit

Description Yes/No
Please check if this a new feature you are proposing
Please check if the build works in docker but not in kaniko
Please check if this error is seen when you use --cache flag
Please check if your dockerfile is a multistage dockerfile

Log:

val ""
val 2
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
github.com/GoogleContainerTools/kaniko/pkg/dockerfile.stripEnclosingQuotes(0xc0004cd810, 0x2, 0x2, 0x1, 0xc0004cd810, 0x2, 0x2, 0x0)
	/go/src/github.com/GoogleContainerTools/kaniko/pkg/dockerfile/dockerfile.go:137 +0x4ad
github.com/GoogleContainerTools/kaniko/pkg/dockerfile.Parse(0xc0008ee000, 0xfa, 0x2fa, 0xfa, 0x2fa, 0x0, 0x0, 0x0, 0xc000104990, 0x0, ...)
	/go/src/github.com/GoogleContainerTools/kaniko/pkg/dockerfile/dockerfile.go:115 +0xfd
github.com/GoogleContainerTools/kaniko/pkg/dockerfile.Stages(0x30f5f20, 0x6502681, 0x30f5980, 0x4fecae, 0x28, 0x203000)
	/go/src/github.com/GoogleContainerTools/kaniko/pkg/dockerfile/dockerfile.go:56 +0x12c
github.com/GoogleContainerTools/kaniko/pkg/executor.DoBuild(0x30f5f20, 0x1, 0x0, 0x0, 0xc0005b6500)
	/go/src/github.com/GoogleContainerTools/kaniko/pkg/executor/build.go:426 +0xcf
github.com/GoogleContainerTools/kaniko/cmd/executor/cmd.glob..func2(0x30e5580, 0xc000105dd0, 0x0, 0x9)
	/go/src/github.com/GoogleContainerTools/kaniko/cmd/executor/cmd/root.go:92 +0x11b
github.com/GoogleContainerTools/kaniko/vendor/github.com/spf13/cobra.(*Command).execute(0x30e5580, 0xc00003a0b0, 0x9, 0x9, 0x30e5580, 0xc00003a0b0)
	/go/src/github.com/GoogleContainerTools/kaniko/vendor/github.com/spf13/cobra/command.go:766 +0x2ae
github.com/GoogleContainerTools/kaniko/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x30e5580, 0x17a26bd, 0xc0005e7f88, 0xc0000461d8)
	/go/src/github.com/GoogleContainerTools/kaniko/vendor/github.com/spf13/cobra/command.go:852 +0x2ec
github.com/GoogleContainerTools/kaniko/vendor/github.com/spf13/cobra.(*Command).Execute(...)
	/go/src/github.com/GoogleContainerTools/kaniko/vendor/github.com/spf13/cobra/command.go:800
main.main()
	/go/src/github.com/GoogleContainerTools/kaniko/cmd/executor/main.go:26 +0x2e
@cvgw cvgw self-assigned this Nov 8, 2019
@cvgw cvgw added kind/bug Something isn't working area/behavior all bugs related to kaniko behavior like running in as root labels Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/behavior all bugs related to kaniko behavior like running in as root kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants