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

Validate pipeline config #1881

Merged

Conversation

corneliusweig
Copy link
Contributor

Fields annotated with 'oneOf' should only be specified once by the user. If conflicting fields are set for a given struct, Skaffold now fails with an error.

Close #1836

@codecov-io
Copy link

codecov-io commented Mar 27, 2019

Codecov Report

Merging #1881 into master will increase coverage by 0.26%.
The diff coverage is 94.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1881      +/-   ##
==========================================
+ Coverage   51.45%   51.72%   +0.26%     
==========================================
  Files         171      172       +1     
  Lines        7690     7735      +45     
==========================================
+ Hits         3957     4001      +44     
- Misses       3357     3358       +1     
  Partials      376      376
Impacted Files Coverage Δ
cmd/skaffold/app/cmd/runner.go 0% <0%> (ø) ⬆️
pkg/skaffold/schema/profiles.go 90.22% <100%> (-0.43%) ⬇️
pkg/skaffold/schema/util/util.go 75% <100%> (+15%) ⬆️
pkg/skaffold/schema/validation/validation.go 100% <100%> (ø)

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 d88680e...b3fb291. Read the comment docs.

@balopat balopat added the kokoro:run runs the kokoro jobs on a PR label Mar 27, 2019
@balopat
Copy link
Contributor

balopat commented Mar 27, 2019

Awesome, thank you! Will have a deeper look tomorrow.

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

balopat commented Mar 27, 2019

bunch of errors on integration tests:

=== RUN   TestBuild/git_tagger
time="2019-03-27T02:04:04Z" level=info msg="[skaffold build -p gitCommit]"
Complete in 1.188978ms
panic: reflect: Field index out of bounds

goroutine 1 [running]:
reflect.(*structType).Field(0x14d6600, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/usr/local/go/src/reflect/type.go:1196 +0x1f4
reflect.(*rtype).Field(0x14d6600, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/usr/local/go/src/reflect/type.go:931 +0x8c
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x14d6600, 0x2640598, 0x199, 0x14d6600, 0x2640598)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:53 +0x1f9
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x13e0800, 0x2640598, 0x96, 0x13e0800, 0x2640598)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:94 +0xdb8
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x15b3ca0, 0xc00000e848, 0x99, 0x15b3ca0, 0xc00000e848)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:69 +0x747
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x15b3a60, 0xc00000e830, 0x99, 0x15b3a60, 0xc00000e830)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:69 +0x747
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x15f3e40, 0xc00000e820, 0x199, 0x15f3e40, 0xc00000e820)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:69 +0x747
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x1413f20, 0xc0003042e8, 0x97, 0x1413f20, 0xc0003042e8)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:83 +0xb76
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x15f3f40, 0xc000304240, 0x199, 0x15f3f40, 0xc000304240)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:69 +0x747
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x14e1140, 0xc000304000, 0xc0002b0250, 0x10, 0x0)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:94 +0xdb8
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.ValidateSchema(0xc000304000, 0xd, 0x4f5601)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:31 +0x4c
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.newRunner(0x26219c0, 0x43498e, 0xc000517b28, 0x455d80, 0xc000517b70)
	/go/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd/runner.go:47 +0x92
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.createRunnerAndBuild(0x18a0d80, 0xc000039a00, 0x1883620, 0xc00000c018, 0x0, 0x0, 0x0, 0x0, 0x0)
	/go/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd/build.go:103 +0x5e
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.runBuild(0x1883620, 0xc00000c018, 0x0, 0x0)
	/go/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd/build.go:86 +0x15e
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.NewCmdBuild.func1(0xc0003c3180, 0xc00039c760, 0x0, 0x2, 0x0, 0x0)
	/go/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd/build.go:53 +0x60
github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).execute(0xc0003c3180, 0xc00039c740, 0x2, 0x2, 0xc0003c3180, 0xc00039c740)
	/go/src/github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra/command.go:762 +0x473
github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc0003c2280, 0xc0003c2c80, 0xc0003c2a00, 0xc0003c2780)
	/go/src/github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra/command.go:852 +0x2fd
github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).Execute(0xc0003c2280, 0xc00000c018, 0x1883620)
	/go/src/github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra/command.go:800 +0x2b
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app.Run(0x1883620, 0xc00000c018, 0x1883620, 0xc00000c020, 0xc00009a058, 0x0)
	/go/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/skaffold.go:35 +0xa5
main.main()
	/go/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/skaffold.go:30 +0x4e
=== RUN   TestBuild/sha256_tagger
time="2019-03-27T02:04:04Z" level=info msg="[skaffold build -p sha256]"
Complete in 1.197565ms
panic: reflect: Field index out of bounds

goroutine 1 [running]:
reflect.(*structType).Field(0x14d6600, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/usr/local/go/src/reflect/type.go:1196 +0x1f4
reflect.(*rtype).Field(0x14d6600, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/usr/local/go/src/reflect/type.go:931 +0x8c
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x14d6600, 0x2640598, 0x199, 0x14d6600, 0x2640598)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:53 +0x1f9
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x13e0800, 0x2640598, 0x96, 0x13e0800, 0x2640598)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:94 +0xdb8
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x15b3ca0, 0xc00013a9e8, 0x99, 0x15b3ca0, 0xc00013a9e8)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:69 +0x747
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x15b3a60, 0xc00013a9d0, 0x99, 0x15b3a60, 0xc00013a9d0)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:69 +0x747
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x15f3e40, 0xc00013a9c0, 0x199, 0x15f3e40, 0xc00013a9c0)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:69 +0x747
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x1413f20, 0xc0002fe2e8, 0x97, 0x1413f20, 0xc0002fe2e8)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:83 +0xb76
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x15f3f40, 0xc0002fe240, 0x199, 0x15f3f40, 0xc0002fe240)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:69 +0x747
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x14e1140, 0xc0002fe000, 0xc00014cca0, 0x10, 0x0)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:94 +0xdb8
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.ValidateSchema(0xc0002fe000, 0xd, 0x4f5601)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:31 +0x4c
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.newRunner(0x26219c0, 0x43498e, 0xc0004f1b28, 0x455d80, 0xc0004f1b70)
	/go/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd/runner.go:47 +0x92
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.createRunnerAndBuild(0x18a0d80, 0xc00016a800, 0x1883620, 0xc00000c018, 0x0, 0x0, 0x0, 0x0, 0x0)
	/go/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd/build.go:103 +0x5e
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.runBuild(0x1883620, 0xc00000c018, 0x0, 0x0)
	/go/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd/build.go:86 +0x15e
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.NewCmdBuild.func1(0xc000403900, 0xc000148640, 0x0, 0x2, 0x0, 0x0)
	/go/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd/build.go:53 +0x60
github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).execute(0xc000403900, 0xc000148620, 0x2, 0x2, 0xc000403900, 0xc000148620)
	/go/src/github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra/command.go:762 +0x473
github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc000402280, 0xc000403400, 0xc000403180, 0xc000402c80)
	/go/src/github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra/command.go:852 +0x2fd
github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).Execute(0xc000402280, 0xc00000c018, 0x1883620)
	/go/src/github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra/command.go:800 +0x2b
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app.Run(0x1883620, 0xc00000c018, 0x1883620, 0xc00000c020, 0xc00009a058, 0x0)
	/go/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/skaffold.go:35 +0xa5
main.main()
	/go/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/skaffold.go:30 +0x4e
=== RUN   TestBuild/dateTime_tagger
time="2019-03-27T02:04:04Z" level=info msg="[skaffold build -p dateTime]"
Complete in 1.326956ms
panic: reflect: Field index out of bounds

goroutine 1 [running]:
reflect.(*structType).Field(0x14d6600, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/usr/local/go/src/reflect/type.go:1196 +0x1f4
reflect.(*rtype).Field(0x14d6600, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/usr/local/go/src/reflect/type.go:931 +0x8c
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x14d6600, 0x2640598, 0x199, 0x14d6600, 0x2640598)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:53 +0x1f9
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x13e0800, 0x2640598, 0x96, 0x13e0800, 0x2640598)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:94 +0xdb8
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x15b3ca0, 0xc00012b138, 0x99, 0x15b3ca0, 0xc00012b138)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:69 +0x747
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x15b3a60, 0xc00012b120, 0x99, 0x15b3a60, 0xc00012b120)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:69 +0x747
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x15f3e40, 0xc00012b110, 0x199, 0x15f3e40, 0xc00012b110)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:69 +0x747
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x1413f20, 0xc00020c2e8, 0x97, 0x1413f20, 0xc00020c2e8)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:83 +0xb76
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x15f3f40, 0xc00020c240, 0x199, 0x15f3f40, 0xc00020c240)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:69 +0x747
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x14e1140, 0xc00020c000, 0xc00024c250, 0x10, 0x0)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:94 +0xdb8
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.ValidateSchema(0xc00020c000, 0xd, 0x4f5601)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:31 +0x4c
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.newRunner(0x26219c0, 0x43498e, 0xc0004dfb28, 0x455d80, 0xc0004dfb70)
	/go/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd/runner.go:47 +0x92
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.createRunnerAndBuild(0x18a0d80, 0xc00001c540, 0x1883620, 0xc00000c018, 0x0, 0x0, 0x0, 0x0, 0x0)
	/go/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd/build.go:103 +0x5e
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.runBuild(0x1883620, 0xc00000c018, 0x0, 0x0)
	/go/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd/build.go:86 +0x15e
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.NewCmdBuild.func1(0xc0003bd900, 0xc000138560, 0x0, 0x2, 0x0, 0x0)
	/go/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd/build.go:53 +0x60
github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).execute(0xc0003bd900, 0xc000138540, 0x2, 0x2, 0xc0003bd900, 0xc000138540)
	/go/src/github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra/command.go:762 +0x473
github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc0003bc280, 0xc0003bd400, 0xc0003bd180, 0xc0003bcc80)
	/go/src/github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra/command.go:852 +0x2fd
github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).Execute(0xc0003bc280, 0xc00000c018, 0x1883620)
	/go/src/github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra/command.go:800 +0x2b
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app.Run(0x1883620, 0xc00000c018, 0x1883620, 0xc00000c020, 0xc00009a058, 0x0)
	/go/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/skaffold.go:35 +0xa5
main.main()
	/go/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/skaffold.go:30 +0x4e
=== RUN   TestBuild/envTemplate_tagger
time="2019-03-27T02:04:04Z" level=info msg="[skaffold build -p envTemplate]"
Complete in 852.187µs
panic: reflect: Field index out of bounds

goroutine 1 [running]:
reflect.(*structType).Field(0x14d6600, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/usr/local/go/src/reflect/type.go:1196 +0x1f4
reflect.(*rtype).Field(0x14d6600, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/usr/local/go/src/reflect/type.go:931 +0x8c
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x14d6600, 0x2640598, 0x199, 0x14d6600, 0x2640598)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:53 +0x1f9
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x13e0800, 0x2640598, 0x96, 0x13e0800, 0x2640598)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:94 +0xdb8
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x15b3ca0, 0xc00012da28, 0x99, 0x15b3ca0, 0xc00012da28)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:69 +0x747
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x15b3a60, 0xc00012da10, 0x99, 0x15b3a60, 0xc00012da10)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:69 +0x747
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x15f3e40, 0xc00012da00, 0x199, 0x15f3e40, 0xc00012da00)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:69 +0x747
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x1413f20, 0xc000026468, 0x97, 0x1413f20, 0xc000026468)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:83 +0xb76
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x15f3f40, 0xc0000263c0, 0x199, 0x15f3f40, 0xc0000263c0)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:69 +0x747
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.validateOneOf(0x14e1140, 0xc000026180, 0xc0004c5210, 0x10, 0x0)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:94 +0xdb8
github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation.ValidateSchema(0xc000026180, 0xd, 0x4f5601)
	/go/src/github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/validation/validation.go:31 +0x4c
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.newRunner(0x26219c0, 0x43498e, 0xc0002dfb28, 0x455d80, 0xc0002dfb70)
	/go/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd/runner.go:47 +0x92
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.createRunnerAndBuild(0x18a0d80, 0xc000039a80, 0x1883620, 0xc00000c018, 0x0, 0x0, 0x0, 0x0, 0x0)
	/go/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd/build.go:103 +0x5e
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.runBuild(0x1883620, 0xc00000c018, 0x0, 0x0)
	/go/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd/build.go:86 +0x15e
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.NewCmdBuild.func1(0xc00035af00, 0xc0002a8540, 0x0, 0x2, 0x0, 0x0)
	/go/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd/build.go:53 +0x60
github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).execute(0xc00035af00, 0xc0002a8520, 0x2, 0x2, 0xc00035af00, 0xc0002a8520)
	/go/src/github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra/command.go:762 +0x473
github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc00035a000, 0xc00035a780, 0xc00035a500, 0xc00035a280)
	/go/src/github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra/command.go:852 +0x2fd
github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).Execute(0xc00035a000, 0xc00000c018, 0x1883620)
	/go/src/github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra/command.go:800 +0x2b
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app.Run(0x1883620, 0xc00000c018, 0x1883620, 0xc00000c020, 0xc000088058, 0x0)
	/go/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/skaffold.go:35 +0xa5
main.main()
	/go/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/skaffold.go:30 +0x4e
--- FAIL: TestBuild (6.83s)
    --- PASS: TestBuild/docker_build (6.69s)
    --- FAIL: TestBuild/git_tagger (0.03s)
        build_test.go:59: skaffold build: exit status 2
    --- FAIL: TestBuild/sha256_tagger (0.04s)
        build_test.go:59: skaffold build: exit status 2
    --- FAIL: TestBuild/dateTime_tagger (0.03s)
        build_test.go:59: skaffold build: exit status 2
    --- FAIL: TestBuild/envTemplate_tagger (0.03s)
        build_test.go:59: skaffold build: exit status 2
```

@corneliusweig
Copy link
Contributor Author

@balopat My bad, forgot that some structs may have no fields.

@balopat balopat added the kokoro:run runs the kokoro jobs on a PR label Mar 27, 2019
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Mar 27, 2019
Copy link
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.

LGTM - just nits

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

1 similar comment
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@corneliusweig corneliusweig force-pushed the validate-pipeline-config branch from d79df76 to e2eab9d Compare March 27, 2019 21:12
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@corneliusweig
Copy link
Contributor Author

@balopat nits are done. I also added one more commit, moving the validation down after profile application. It occured to me that this could also create oneOf conflicts.

Fields annotated with 'oneOf' should only be specified once by the user.
If conflicting fields are set for a given struct, Skaffold fails with an error.

Fix validation for structs without fields

Signed-off-by: Cornelius Weig <[email protected]>
@corneliusweig corneliusweig force-pushed the validate-pipeline-config branch from a9fac45 to b3fb291 Compare March 28, 2019 10:22
@tejal29 tejal29 added the kokoro:run runs the kokoro jobs on a PR label Apr 1, 2019
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Apr 1, 2019
@balopat balopat merged commit 0470bad into GoogleContainerTools:master Apr 2, 2019
@corneliusweig corneliusweig deleted the validate-pipeline-config branch April 2, 2019 22:25
@tejal29 tejal29 mentioned this pull request Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants