Skip to content

remove mandate of GCR creds for kaniko build#1728

Closed
venkatk-25 wants to merge 6 commits intoGoogleContainerTools:masterfrom
venkatk-25:make_gcr_creds_optional_in_kaniko
Closed

remove mandate of GCR creds for kaniko build#1728
venkatk-25 wants to merge 6 commits intoGoogleContainerTools:masterfrom
venkatk-25:make_gcr_creds_optional_in_kaniko

Conversation

@venkatk-25
Copy link
Copy Markdown
Contributor

Currently Kaniko build requires configuring GCR credentials even if I am not using it,
This change makes GCR creds optional and also makes adding other registry like ECR easy in future

@codecov-io
Copy link
Copy Markdown

codecov-io commented Mar 5, 2019

Codecov Report

Merging #1728 into master will increase coverage by 1.02%.
The diff coverage is 20.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1728      +/-   ##
==========================================
+ Coverage    46.4%   47.43%   +1.02%     
==========================================
  Files         132      136       +4     
  Lines        6322     6670     +348     
==========================================
+ Hits         2934     3164     +230     
- Misses       3087     3187     +100     
- Partials      301      319      +18
Impacted Files Coverage Δ
pkg/skaffold/schema/v1beta5/upgrade.go 63.63% <ø> (ø) ⬆️
pkg/skaffold/schema/defaults/defaults.go 37.17% <0%> (-0.49%) ⬇️
pkg/skaffold/build/kaniko/secret.go 0% <0%> (ø) ⬆️
pkg/skaffold/schema/v1beta6/upgrade.go 61.29% <55.55%> (-2.35%) ⬇️
pkg/skaffold/build/cache/hash.go 66.66% <0%> (ø)
pkg/skaffold/build/cache/retrieve.go 88.09% <0%> (ø)
pkg/skaffold/build/cache/save.go 0% <0%> (ø)
pkg/skaffold/build/cache/cache.go 65.95% <0%> (ø)
pkg/skaffold/runner/runner.go 66.66% <0%> (+5.81%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9e0d4b7...9eda366. Read the comment docs.

@balopat balopat assigned balopat and unassigned balopat Mar 7, 2019
@balopat balopat added the kokoro:run runs the kokoro jobs on a PR label Mar 7, 2019
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Mar 7, 2019
Copy link
Copy Markdown
Contributor

@balopat balopat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good - but we need to add a logic for migration between the old version and the new version as you are moving fields. You can either keep the fields around as they are and just include your optionality logic or you have to implement skaffold fix logic for autoupgrading.

@balopat balopat added the kokoro:run runs the kokoro jobs on a PR label Mar 7, 2019
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Mar 8, 2019
@venkatk-25
Copy link
Copy Markdown
Contributor Author

I have already made changes for skaffold fix in pkg/skaffold/schema/v1beta5/upgrade.go
Did I miss anything else. Should I move the logic to v1beta6 ?

@balopat
Copy link
Copy Markdown
Contributor

balopat commented Mar 8, 2019

I have already made changes for skaffold fix in pkg/skaffold/schema/v1beta5/upgrade.go
Did I miss anything else. Should I move the logic to v1beta6 ?

Oh, yeah, I missed that. It looks good :)
And yes, as this introduces a config change, I merged v1beta7 - so this change should land in that version, thus the upgrade will have to be in v1beta6 - please update it - it's a bit of an inconvenience - between the releases this always happens with the first config-change introducing PRs.

@venkatk-25
Copy link
Copy Markdown
Contributor Author

I have made changes required and moves the fix to v1beta6

@balopat balopat added the kokoro:run runs the kokoro jobs on a PR label Mar 11, 2019
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Mar 11, 2019
@dgageot
Copy link
Copy Markdown
Contributor

dgageot commented Mar 12, 2019

@venkatk-25 Could you do one more rebase, please? 🥇

@venkatk-25
Copy link
Copy Markdown
Contributor Author

@dgageot done

@balopat balopat added the kokoro:run runs the kokoro jobs on a PR label Mar 14, 2019
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Mar 14, 2019
@balopat
Copy link
Copy Markdown
Contributor

balopat commented Mar 15, 2019

There is an integration test issue:

 REMOTE_INTEGRATION=true go test -v github.com/GoogleContainerTools/skaffold/integration -timeout 10m -run TestRun/kaniko 

will result in (after this fix):

=== RUN   TestRun
=== RUN   TestRun/kaniko
Namespace: skaffoldf9ct5
=== RUN   TestRun/kaniko_local
Namespace: skaffoldscr62
=== RUN   TestRun/kaniko_local_-_sub_folder
Namespace: skaffoldsld7t
--- FAIL: TestRun (5.10s)
    --- FAIL: TestRun/kaniko (2.66s)
        run_test.go:126: skaffold run: exit status 1, Generating tags...
             - gcr.io/k8s-skaffold/skaffold-example -> gcr.io/k8s-skaffold/skaffold-example:9eda3665a
            Tags generated in 9.246785ms
            Starting build...
            Creating kaniko secret [e2esecret]...
            Building [gcr.io/k8s-skaffold/skaffold-example]...
            Uploading sources to skaffold-kaniko GCS bucket
            time="2019-03-14T17:44:12-07:00" level=fatal msg="build failed: building [gcr.io/k8s-skaffold/skaffold-example]: kaniko build for [gcr.io/k8s-skaffold/skaffold-example]: setting up build context: uploading sources to GCS: Post https://www.googleapis.com/upload/storage/v1/b/skaffold-kaniko/o?alt=json&projection=full&uploadType=multipart: oauth2: cannot fetch token: 400 Bad Request\nResponse: {\n  \"error\": \"invalid_grant\",\n  \"error_description\": \"Bad Request\"\n}"
    --- FAIL: TestRun/kaniko_local (1.19s)
        run_test.go:126: skaffold run: exit status 2, Generating tags...
             - gcr.io/k8s-skaffold/skaffold-example -> gcr.io/k8s-skaffold/skaffold-example:9eda3665a
            Tags generated in 14.555393ms
            Starting build...
            Creating kaniko secret [e2esecret]...
            Building [gcr.io/k8s-skaffold/skaffold-example]...
            Storing build context at /tmp/context-ba9e7d925f1c91e5688d5e32cfd12537.tar.gz
            panic: runtime error: invalid memory address or nil pointer dereference
            [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x123c93a]
            
            goroutine 1 [running]:
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/kaniko/sources.addDockerConfig(...)
                pkg/skaffold/build/kaniko/sources/sources.go:125
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/kaniko/sources.podTemplate(0xc0002b6380, 0xc000340b00, 0xa, 0x10, 0xc0006fd018)
                pkg/skaffold/build/kaniko/sources/sources.go:78 +0x3fa
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/kaniko/sources.(*LocalDir).Pod(0xc0005e5c00, 0xc000340b00, 0xa, 0x10, 0x0)
                pkg/skaffold/build/kaniko/sources/localdir.go:87 +0x23c
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/kaniko.(*Builder).run(0xc000313e20, 0x191df40, 0xc000320600, 0x18e7120, 0xc00000e018, 0xc000328b40, 0xc000391050, 0x2e, 0x0, 0x0, ...)
                pkg/skaffold/build/kaniko/run.go:73 +0x574
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/kaniko.(*Builder).buildArtifactWithKaniko(0xc000313e20, 0x191df40, 0xc000320600, 0x18e7120, 0xc00000e018, 0xc000328b40, 0xc000391050, 0x2e, 0x30, 0xc00048afc0, ...)
                pkg/skaffold/build/kaniko/kaniko.go:49 +0x9b
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build.InSequence(0x191df40, 0xc000320600, 0x18e7120, 0xc00000e018, 0xc00022a090, 0xc000318118, 0x1, 0x1, 0xc0005dd660, 0xd41, ...)
                pkg/skaffold/build/sequence.go:52 +0x28c
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build.InParallel(0x191df40, 0xc000320600, 0x18e7120, 0xc00000e018, 0xc00022a090, 0xc000318118, 0x1, 0x1, 0xc0005dd660, 0x0, ...)
                pkg/skaffold/build/parallel.go:40 +0x8f4
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/kaniko.(*Builder).Build(0xc000313e20, 0x191df40, 0xc000320600, 0x18e7120, 0xc00000e018, 0xc00022a090, 0xc000318118, 0x1, 0x1, 0x0, ...)
                pkg/skaffold/build/kaniko/kaniko.go:45 +0x15d
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/runner.withTimings.Build(0x19067c0, 0xc000313e20, 0x1901100, 0xc000155e90, 0x191e280, 0xc000204a80, 0x0, 0x191df40, 0xc000320600, 0x18e7120, ...)
                pkg/skaffold/runner/timings.go:64 +0x169
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/runner.(*SkaffoldRunner).BuildAndTest(0xc0002be750, 0x191df40, 0xc000320600, 0x18e7120, 0xc00000e018, 0xc000318118, 0x1, 0x1, 0x18c23b0, 0x435dbf, ...)
                pkg/skaffold/runner/runner.go:329 +0x20f
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/runner.(*SkaffoldRunner).buildTestDeploy(0xc0002be750, 0x191df40, 0xc000320600, 0x18e7120, 0xc00000e018, 0xc000318118, 0x1, 0x1, 0x10, 0xc00058fc30)
                pkg/skaffold/runner/runner.go:258 +0x9b
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/runner.(*SkaffoldRunner).Run(0xc0002be750, 0x191df40, 0xc000320600, 0x18e7120, 0xc00000e018, 0xc000318118, 0x1, 0x1, 0xc000424380, 0x10)
                pkg/skaffold/runner/runner.go:280 +0x81
            github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.run(0x18e7120, 0xc00000e018, 0x0, 0x0)
                cmd/skaffold/app/cmd/run.go:61 +0x144
            github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.NewCmdRun.func1(0xc0003a6c80, 0xc0003387c0, 0x0, 0x2, 0x0, 0x0)
                cmd/skaffold/app/cmd/run.go:36 +0x71
            github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).execute(0xc0003a6c80, 0xc0003387a0, 0x2, 0x2, 0xc0003a6c80, 0xc0003387a0)
                vendor/github.com/spf13/cobra/command.go:762 +0x465
            github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x26c5400, 0xc00000e018, 0x18e7120, 0xc00000e020)
                vendor/github.com/spf13/cobra/command.go:852 +0x2c0
            github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).Execute(...)
                vendor/github.com/spf13/cobra/command.go:800
            github.com/GoogleContainerTools/skaffold/cmd/skaffold/app.Run(0x0, 0x0)
                cmd/skaffold/app/skaffold.go:32 +0x8a
            main.main()
                cmd/skaffold/skaffold.go:29 +0x26
    --- FAIL: TestRun/kaniko_local_-_sub_folder (1.25s)
        run_test.go:126: skaffold run: exit status 2, time="2019-03-14T17:44:13-07:00" level=warning msg="config version (skaffold/v1beta4) out of date: upgrading to latest (skaffold/v1beta7)"
            Generating tags...
             - gcr.io/k8s-skaffold/skaffold-example-sub -> gcr.io/k8s-skaffold/skaffold-example-sub:9eda3665a
            Tags generated in 20.264377ms
            Starting build...
            Creating kaniko secret [e2esecret]...
            Building [gcr.io/k8s-skaffold/skaffold-example-sub]...
            Storing build context at /tmp/context-db5fc416f545d4a934de0101cc2cb0e6.tar.gz
            panic: runtime error: invalid memory address or nil pointer dereference
            [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x123c93a]
            
            goroutine 1 [running]:
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/kaniko/sources.addDockerConfig(...)
                pkg/skaffold/build/kaniko/sources/sources.go:125
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/kaniko/sources.podTemplate(0xc00023e0e0, 0xc00042a600, 0x8, 0x8, 0xc000659018)
                pkg/skaffold/build/kaniko/sources/sources.go:78 +0x3fa
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/kaniko/sources.(*LocalDir).Pod(0xc0005e5fc0, 0xc00042a600, 0x8, 0x8, 0x0)
                pkg/skaffold/build/kaniko/sources/localdir.go:87 +0x23c
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/kaniko.(*Builder).run(0xc0002ee2b0, 0x191df40, 0xc000341580, 0x18e7120, 0xc0000c2008, 0xc0003443c0, 0xc000023a00, 0x32, 0x0, 0x0, ...)
                pkg/skaffold/build/kaniko/run.go:73 +0x574
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/kaniko.(*Builder).buildArtifactWithKaniko(0xc0002ee2b0, 0x191df40, 0xc000341580, 0x18e7120, 0xc0000c2008, 0xc0003443c0, 0xc000023a00, 0x32, 0x30, 0xc000187440, ...)
                pkg/skaffold/build/kaniko/kaniko.go:49 +0x9b
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build.InSequence(0x191df40, 0xc000341580, 0x18e7120, 0xc0000c2008, 0xc0004a8bd0, 0xc00032dc20, 0x1, 0x4, 0xc0005e2c60, 0xd41, ...)
                pkg/skaffold/build/sequence.go:52 +0x28c
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build.InParallel(0x191df40, 0xc000341580, 0x18e7120, 0xc0000c2008, 0xc0004a8bd0, 0xc00032dc20, 0x1, 0x4, 0xc0005e2c60, 0x0, ...)
                pkg/skaffold/build/parallel.go:40 +0x8f4
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/kaniko.(*Builder).Build(0xc0002ee2b0, 0x191df40, 0xc000341580, 0x18e7120, 0xc0000c2008, 0xc0004a8bd0, 0xc00032dc20, 0x1, 0x4, 0x0, ...)
                pkg/skaffold/build/kaniko/kaniko.go:45 +0x15d
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/runner.withTimings.Build(0x19067c0, 0xc0002ee2b0, 0x1901100, 0xc0004a89f0, 0x191e280, 0xc00002ca80, 0x0, 0x191df40, 0xc000341580, 0x18e7120, ...)
                pkg/skaffold/runner/timings.go:64 +0x169
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/runner.(*SkaffoldRunner).BuildAndTest(0xc0002a1930, 0x191df40, 0xc000341580, 0x18e7120, 0xc0000c2008, 0xc00032dc20, 0x1, 0x4, 0x18c23b0, 0x435dbf, ...)
                pkg/skaffold/runner/runner.go:329 +0x20f
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/runner.(*SkaffoldRunner).buildTestDeploy(0xc0002a1930, 0x191df40, 0xc000341580, 0x18e7120, 0xc0000c2008, 0xc00032dc20, 0x1, 0x4, 0x10, 0xc00025fc30)
                pkg/skaffold/runner/runner.go:258 +0x9b
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/runner.(*SkaffoldRunner).Run(0xc0002a1930, 0x191df40, 0xc000341580, 0x18e7120, 0xc0000c2008, 0xc00032dc20, 0x1, 0x4, 0xc00024d080, 0x10)
                pkg/skaffold/runner/runner.go:280 +0x81
            github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.run(0x18e7120, 0xc0000c2008, 0x0, 0x0)
                cmd/skaffold/app/cmd/run.go:61 +0x144
            github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.NewCmdRun.func1(0xc00036cf00, 0xc0002403c0, 0x0, 0x2, 0x0, 0x0)
                cmd/skaffold/app/cmd/run.go:36 +0x71
            github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).execute(0xc00036cf00, 0xc0002403a0, 0x2, 0x2, 0xc00036cf00, 0xc0002403a0)
                vendor/github.com/spf13/cobra/command.go:762 +0x465
            github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x26c5400, 0xc0000c2008, 0x18e7120, 0xc0000c2010)
                vendor/github.com/spf13/cobra/command.go:852 +0x2c0
            github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).Execute(...)
                vendor/github.com/spf13/cobra/command.go:800
            github.com/GoogleContainerTools/skaffold/cmd/skaffold/app.Run(0x0, 0x0)
                cmd/skaffold/app/skaffold.go:32 +0x8a
            main.main()
                cmd/skaffold/skaffold.go:29 +0x26
FAIL
FAIL    github.com/GoogleContainerTools/skaffold/integration    5.270s
 1  gke_k8s-skaffold_us-central1-a_integration-tests  ~/g/s/g/G/skaffold   make_gcr_creds_optional_in_kaniko  +1/-1    env REMOTE_INTEGRATION=true go test -v github.com/GoogleContainerTools/skaffold/integration -timeout 10m -run TestRun/kaniko                                                                     7.4s  Thu 14 Mar 2019 05:44:14 PM PDT
=== RUN   TestRun
=== RUN   TestRun/kaniko
Namespace: skaffoldmtxnm
=== RUN   TestRun/kaniko_local
Namespace: skaffold99qlx
=== RUN   TestRun/kaniko_local_-_sub_folder
Namespace: skaffoldfvxw6
--- FAIL: TestRun (4.03s)
    --- FAIL: TestRun/kaniko (1.58s)
        run_test.go:126: skaffold run: exit status 1, Generating tags...
             - gcr.io/k8s-skaffold/skaffold-example -> gcr.io/k8s-skaffold/skaffold-example:9eda3665a
            Tags generated in 16.511533ms
            Starting build...
            Creating kaniko secret [e2esecret]...
            Building [gcr.io/k8s-skaffold/skaffold-example]...
            Uploading sources to skaffold-kaniko GCS bucket
    --- FAIL: TestRun/kaniko_local (1.23s)
        run_test.go:126: skaffold run: exit status 2, Generating tags...
             - gcr.io/k8s-skaffold/skaffold-example -> gcr.io/k8s-skaffold/skaffold-example:9eda3665a
            Tags generated in 14.472369ms
            Starting build...
            Creating kaniko secret [e2esecret]...
            Building [gcr.io/k8s-skaffold/skaffold-example]...
            Storing build context at /tmp/context-484f866934d6d689fda2a2d780eef418.tar.gz
    --- FAIL: TestRun/kaniko_local_-_sub_folder (1.22s)
        run_test.go:126: skaffold run: exit status 2, Generating tags...
             - gcr.io/k8s-skaffold/skaffold-example-sub -> gcr.io/k8s-skaffold/skaffold-example-sub:9eda3665a
            Tags generated in 15.690033ms
            Starting build...
            Creating kaniko secret [e2esecret]...
            Building [gcr.io/k8s-skaffold/skaffold-example-sub]...
            Storing build context at /tmp/context-a4a402dbe6d781c7b01a62a2dedae018.tar.gz
FAIL
FAIL    github.com/GoogleContainerTools/skaffold/integration    4.201s
 1  gke_k8s-skaffold_us-central1-a_integration-tests  ~/g/s/g/G/skaffold   make_gcr_creds_optional_in_kaniko    env REMOTE_INTEGRATION=true go test -v github.com/GoogleContainerTools/skaffold/integration -timeout 10m -run TestRun/kaniko                                                                             6.3s  Thu 14 Mar 2019 05:45:14 PM PDT
=== RUN   TestRun
=== RUN   TestRun/kaniko
Namespace: skaffoldkt7rd
=== RUN   TestRun/kaniko_local
Namespace: skaffold7qcr7
=== RUN   TestRun/kaniko_local_-_sub_folder
Namespace: skaffoldtxg69
--- FAIL: TestRun (3.99s)
    --- FAIL: TestRun/kaniko (1.56s)
        run_test.go:126: skaffold run: exit status 1, Generating tags...
             - gcr.io/k8s-skaffold/skaffold-example -> gcr.io/k8s-skaffold/skaffold-example:9eda3665a
            Tags generated in 15.519133ms
            Starting build...
            Creating kaniko secret [e2esecret]...
            Building [gcr.io/k8s-skaffold/skaffold-example]...
            Uploading sources to skaffold-kaniko GCS bucket
            time="2019-03-14T17:45:26-07:00" level=fatal msg="build failed: building [gcr.io/k8s-skaffold/skaffold-example]: kaniko build for [gcr.io/k8s-skaffold/skaffold-example]: setting up build context: uploading sources to GCS: Post https://www.googleapis.com/upload/storage/v1/b/skaffold-kaniko/o?alt=json&projection=full&uploadType=multipart: oauth2: cannot fetch token: 400 Bad Request\nResponse: {\n  \"error\": \"invalid_grant\",\n  \"error_description\": \"Bad Request\"\n}"
    --- FAIL: TestRun/kaniko_local (1.21s)
        run_test.go:126: skaffold run: exit status 2, Generating tags...
             - gcr.io/k8s-skaffold/skaffold-example -> gcr.io/k8s-skaffold/skaffold-example:9eda3665a
            Tags generated in 11.572733ms
            Starting build...
            Creating kaniko secret [e2esecret]...
            Building [gcr.io/k8s-skaffold/skaffold-example]...
            Storing build context at /tmp/context-6522eb98686ddfbcf1388d36220dd981.tar.gz
            panic: runtime error: invalid memory address or nil pointer dereference
            [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x123c93a]
            
            goroutine 1 [running]:
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/kaniko/sources.addDockerConfig(...)
                pkg/skaffold/build/kaniko/sources/sources.go:125
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/kaniko/sources.podTemplate(0xc000294b60, 0xc000596100, 0xa, 0x10, 0x4d2420)
                pkg/skaffold/build/kaniko/sources/sources.go:78 +0x3fa
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/kaniko/sources.(*LocalDir).Pod(0xc00055dbe0, 0xc000596100, 0xa, 0x10, 0x0)
                pkg/skaffold/build/kaniko/sources/localdir.go:87 +0x23c
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/kaniko.(*Builder).run(0xc0002c2240, 0x191df40, 0xc000321f00, 0x18e7120, 0xc00000e018, 0xc0003246c0, 0xc000230f30, 0x2e, 0x0, 0x0, ...)
                pkg/skaffold/build/kaniko/run.go:73 +0x574
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/kaniko.(*Builder).buildArtifactWithKaniko(0xc0002c2240, 0x191df40, 0xc000321f00, 0x18e7120, 0xc00000e018, 0xc0003246c0, 0xc000230f30, 0x2e, 0x30, 0xc000021440, ...)
                pkg/skaffold/build/kaniko/kaniko.go:49 +0x9b
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build.InSequence(0x191df40, 0xc000321f00, 0x18e7120, 0xc00000e018, 0xc000024450, 0xc000318cb8, 0x1, 0x1, 0xc000553ed0, 0xd41, ...)
                pkg/skaffold/build/sequence.go:52 +0x28c
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build.InParallel(0x191df40, 0xc000321f00, 0x18e7120, 0xc00000e018, 0xc000024450, 0xc000318cb8, 0x1, 0x1, 0xc000553ed0, 0x0, ...)
                pkg/skaffold/build/parallel.go:40 +0x8f4
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/kaniko.(*Builder).Build(0xc0002c2240, 0x191df40, 0xc000321f00, 0x18e7120, 0xc00000e018, 0xc000024450, 0xc000318cb8, 0x1, 0x1, 0x0, ...)
                pkg/skaffold/build/kaniko/kaniko.go:45 +0x15d
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/runner.withTimings.Build(0x19067c0, 0xc0002c2240, 0x1901100, 0xc000024270, 0x191e280, 0xc000112000, 0x0, 0x191df40, 0xc000321f00, 0x18e7120, ...)
                pkg/skaffold/runner/timings.go:64 +0x169
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/runner.(*SkaffoldRunner).BuildAndTest(0xc0000aa680, 0x191df40, 0xc000321f00, 0x18e7120, 0xc00000e018, 0xc000318cb8, 0x1, 0x1, 0x18c23b0, 0x435dbf, ...)
                pkg/skaffold/runner/runner.go:329 +0x20f
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/runner.(*SkaffoldRunner).buildTestDeploy(0xc0000aa680, 0x191df40, 0xc000321f00, 0x18e7120, 0xc00000e018, 0xc000318cb8, 0x1, 0x1, 0x10, 0xc000253c30)
                pkg/skaffold/runner/runner.go:258 +0x9b
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/runner.(*SkaffoldRunner).Run(0xc0000aa680, 0x191df40, 0xc000321f00, 0x18e7120, 0xc00000e018, 0xc000318cb8, 0x1, 0x1, 0xc000229380, 0x10)
                pkg/skaffold/runner/runner.go:280 +0x81
            github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.run(0x18e7120, 0xc00000e018, 0x0, 0x0)
                cmd/skaffold/app/cmd/run.go:61 +0x144
            github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.NewCmdRun.func1(0xc0002ccc80, 0xc00000d520, 0x0, 0x2, 0x0, 0x0)
                cmd/skaffold/app/cmd/run.go:36 +0x71
            github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).execute(0xc0002ccc80, 0xc00000d500, 0x2, 0x2, 0xc0002ccc80, 0xc00000d500)
                vendor/github.com/spf13/cobra/command.go:762 +0x465
            github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x26c5400, 0xc00000e018, 0x18e7120, 0xc00000e020)
                vendor/github.com/spf13/cobra/command.go:852 +0x2c0
            github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).Execute(...)
                vendor/github.com/spf13/cobra/command.go:800
            github.com/GoogleContainerTools/skaffold/cmd/skaffold/app.Run(0x0, 0x0)
                cmd/skaffold/app/skaffold.go:32 +0x8a
            main.main()
                cmd/skaffold/skaffold.go:29 +0x26
    --- FAIL: TestRun/kaniko_local_-_sub_folder (1.21s)
        run_test.go:126: skaffold run: exit status 2, time="2019-03-14T17:45:28-07:00" level=warning msg="config version (skaffold/v1beta4) out of date: upgrading to latest (skaffold/v1beta7)"
            Generating tags...
             - gcr.io/k8s-skaffold/skaffold-example-sub -> gcr.io/k8s-skaffold/skaffold-example-sub:9eda3665a
            Tags generated in 16.867374ms
            Starting build...
            Creating kaniko secret [e2esecret]...
            Building [gcr.io/k8s-skaffold/skaffold-example-sub]...
            Storing build context at /tmp/context-c2172af7d3419dc107b9bf80b621cba5.tar.gz
            panic: runtime error: invalid memory address or nil pointer dereference
            [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x123c93a]
            
            goroutine 1 [running]:
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/kaniko/sources.addDockerConfig(...)
                pkg/skaffold/build/kaniko/sources/sources.go:125
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/kaniko/sources.podTemplate(0xc000152150, 0xc000308680, 0x8, 0x8, 0xc00060f018)
                pkg/skaffold/build/kaniko/sources/sources.go:78 +0x3fa
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/kaniko/sources.(*LocalDir).Pod(0xc000265340, 0xc000308680, 0x8, 0x8, 0x0)
                pkg/skaffold/build/kaniko/sources/localdir.go:87 +0x23c
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/kaniko.(*Builder).run(0xc0003b2bb0, 0x191df40, 0xc0003206c0, 0x18e7120, 0xc00000e018, 0xc000084600, 0xc00042b840, 0x32, 0x0, 0x0, ...)
                pkg/skaffold/build/kaniko/run.go:73 +0x574
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/kaniko.(*Builder).buildArtifactWithKaniko(0xc0003b2bb0, 0x191df40, 0xc0003206c0, 0x18e7120, 0xc00000e018, 0xc000084600, 0xc00042b840, 0x32, 0x30, 0xc00028aa20, ...)
                pkg/skaffold/build/kaniko/kaniko.go:49 +0x9b
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build.InSequence(0x191df40, 0xc0003206c0, 0x18e7120, 0xc00000e018, 0xc0004e4a20, 0xc00027f540, 0x1, 0x4, 0xc000266900, 0xd41, ...)
                pkg/skaffold/build/sequence.go:52 +0x28c
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build.InParallel(0x191df40, 0xc0003206c0, 0x18e7120, 0xc00000e018, 0xc0004e4a20, 0xc00027f540, 0x1, 0x4, 0xc000266900, 0x0, ...)
                pkg/skaffold/build/parallel.go:40 +0x8f4
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/kaniko.(*Builder).Build(0xc0003b2bb0, 0x191df40, 0xc0003206c0, 0x18e7120, 0xc00000e018, 0xc0004e4a20, 0xc00027f540, 0x1, 0x4, 0x0, ...)
                pkg/skaffold/build/kaniko/kaniko.go:45 +0x15d
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/runner.withTimings.Build(0x19067c0, 0xc0003b2bb0, 0x1901100, 0xc0004e4840, 0x191e280, 0xc0002a4a80, 0x0, 0x191df40, 0xc0003206c0, 0x18e7120, ...)
                pkg/skaffold/runner/timings.go:64 +0x169
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/runner.(*SkaffoldRunner).BuildAndTest(0xc00030be10, 0x191df40, 0xc0003206c0, 0x18e7120, 0xc00000e018, 0xc00027f540, 0x1, 0x4, 0x18c23b0, 0x435dbf, ...)
                pkg/skaffold/runner/runner.go:329 +0x20f
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/runner.(*SkaffoldRunner).buildTestDeploy(0xc00030be10, 0x191df40, 0xc0003206c0, 0x18e7120, 0xc00000e018, 0xc00027f540, 0x1, 0x4, 0x10, 0xc00002dc30)
                pkg/skaffold/runner/runner.go:258 +0x9b
            github.com/GoogleContainerTools/skaffold/pkg/skaffold/runner.(*SkaffoldRunner).Run(0xc00030be10, 0x191df40, 0xc0003206c0, 0x18e7120, 0xc00000e018, 0xc00027f540, 0x1, 0x4, 0xc00016c400, 0x10)
                pkg/skaffold/runner/runner.go:280 +0x81
            github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.run(0x18e7120, 0xc00000e018, 0x0, 0x0)
                cmd/skaffold/app/cmd/run.go:61 +0x144
            github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.NewCmdRun.func1(0xc0003aec80, 0xc00021c580, 0x0, 0x2, 0x0, 0x0)
                cmd/skaffold/app/cmd/run.go:36 +0x71
            github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).execute(0xc0003aec80, 0xc00021c560, 0x2, 0x2, 0xc0003aec80, 0xc00021c560)
                vendor/github.com/spf13/cobra/command.go:762 +0x465
            github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x26c5400, 0xc00000e018, 0x18e7120, 0xc00000e020)
                vendor/github.com/spf13/cobra/command.go:852 +0x2c0
            github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).Execute(...)
                vendor/github.com/spf13/cobra/command.go:800
            github.com/GoogleContainerTools/skaffold/cmd/skaffold/app.Run(0x0, 0x0)
                cmd/skaffold/app/skaffold.go:32 +0x8a
            main.main()
                cmd/skaffold/skaffold.go:29 +0x26
FAIL

},
}

if cfg.GoogleCloudConfig == nil {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if cfg.GoogleCloudConfig == nil {
if cfg.GoogleCloudConfig != nil {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and we should cover this in a unit test too if possible

return addGoogleCloudConfig(pod, cfg.GoogleCloudConfig)
}

if cfg.DockerConfig == nil {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if cfg.DockerConfig == nil {
if cfg.DockerConfig != nil {

and we should cover this in a unit test too if possible

@tejal29
Copy link
Copy Markdown
Contributor

tejal29 commented Mar 20, 2019

@venkatk-25 , in another PR #1700, @azaiter is proposing another way to specify ECR secret.
Maybe you both can collaborate on a config schema which supports other Container Registry which kaniko might support in future.
WDYT?
See #1700 (comment) for more details.

@venkatk-25
Copy link
Copy Markdown
Contributor Author

@tejal29 @balopat @azaiter I have created a new proposal #1892 for the same. Can you go through and let me know your thoughts so I can take it forward and work on it further.

@tejal29
Copy link
Copy Markdown
Contributor

tejal29 commented Apr 4, 2019

@venkatk-25 if this is not the likely direction you are going to head (after #1892) , please close this PR.

@venkatk-25
Copy link
Copy Markdown
Contributor Author

sure, closing this.

@venkatk-25 venkatk-25 closed this Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants