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

ggcr: index out of range when calling mutate.Time from kaniko #1646

Closed
flaviogrossi opened this issue Apr 13, 2023 · 0 comments · Fixed by #1715
Closed

ggcr: index out of range when calling mutate.Time from kaniko #1646

flaviogrossi opened this issue Apr 13, 2023 · 0 comments · Fixed by #1715
Labels
bug Something isn't working

Comments

@flaviogrossi
Copy link

Describe the bug

The following runtime error is raised when using this library from kaniko (please see the additional context section below for more details):

panic: runtime error: index out of range [10] with length 10

goroutine 1 [running]:
github.com/google/go-containerregistry/pkg/v1/mutate.Time({0x1c75df0, 0xc0001262a0}, {0xc000126230?, 0xc000169400?, 0x0?})
        /src/vendor/github.com/google/go-containerregistry/pkg/v1/mutate/mutate.go:405 +0x9f6
github.com/google/go-containerregistry/pkg/v1/mutate.Canonical({0x1c75df0?, 0xc0001262a0?})
        /src/vendor/github.com/google/go-containerregistry/pkg/v1/mutate/mutate.go:509 +0x2d
github.com/GoogleContainerTools/kaniko/pkg/executor.DoBuild(0x27e12a0)
        /src/pkg/executor/build.go:701 +0xf48
github.com/GoogleContainerTools/kaniko/cmd/executor/cmd.glob..func2(0x27cc7e0?, {0x189e453?, 0x4?, 0x4?})
        /src/cmd/executor/cmd/root.go:163 +0x1c7
github.com/spf13/cobra.(*Command).execute(0x27cc7e0, {0xc00003e0b0, 0x4, 0x4})
        /src/vendor/github.com/spf13/cobra/command.go:920 +0x847
github.com/spf13/cobra.(*Command).ExecuteC(0x27cc7e0)
        /src/vendor/github.com/spf13/cobra/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
        /src/vendor/github.com/spf13/cobra/command.go:968
main.main()
        /src/cmd/executor/main.go:31 +0x6c

To Reproduce

The error is raised trying to build an image using kaniko:
docker run -v ./Docker:/d gcr.io/kaniko-project/executor:latest --dockerfile=Dockerfile --context=/d --reproducible --no-push

It happens in a reproducible manner for a particular dockerfile, which i'm currently not able to share since it is using a private registry.
I'm trying to write a minimal self-contained example to expose this problem, but maybe in the meantime the trace is good enough to spot the source of the problem.

Expected behavior

No runtime errors raised

Additional context

The error is raised using kaniko v1.9.2, which uses go-containerregistry v0.14.0.
No errors using the same dockerfile with kaniko v1.9.1 which uses go-containerregistry v0.8.1-0.20220507185902-82405e5dfa82

I think the cuplrit may be commit 9db616f, since the error happens in mutate.Time after trying to index the addendums slice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant