Description of problem: Met panic when set build hook with a empty file Version-Release number of selected component (if applicable): oc v3.11.0-0.10.0 kubernetes v1.11.0+d4cacc0 How reproducible: always Steps to Reproduce: 1.Set build hook with a empty file oc set build-hook -f emptyfile.json --post-commit=true --script=bundle\ exec\ rake\ test 2. 3. Actual results: $ oc set build-hook -f emptyfile.json --post-commit=true --script=bundle\ exec\ rake\ test panic: runtime error: index out of range goroutine 1 [running]: github.com/openshift/origin/pkg/oc/cli/set.(*BuildHookOptions).Run(0xc420612480, 0x0, 0x0) /builddir/build/BUILD/atomic-openshift-git-0.c5fa1e4/_output/local/go/src/github.com/openshift/origin/pkg/oc/cli/set/buildhook.go:220 +0xcaa github.com/openshift/origin/pkg/oc/cli/set.NewCmdBuildHook.func1(0xc4209c8000, 0xc4211f3680, 0x0, 0x4) /builddir/build/BUILD/atomic-openshift-git-0.c5fa1e4/_output/local/go/src/github.com/openshift/origin/pkg/oc/cli/set/buildhook.go:97 +0xb9 github.com/openshift/origin/vendor/github.com/spf13/cobra.(*Command).execute(0xc4209c8000, 0xc4211f3600, 0x4, 0x4, 0xc4209c8000, 0xc4211f3600) /builddir/build/BUILD/atomic-openshift-git-0.c5fa1e4/_output/local/go/src/github.com/openshift/origin/vendor/github.com/spf13/cobra/command.go:760 +0x2c1 github.com/openshift/origin/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc421054780, 0xc42000e010, 0xc42000e020, 0xc421054780) /builddir/build/BUILD/atomic-openshift-git-0.c5fa1e4/_output/local/go/src/github.com/openshift/origin/vendor/github.com/spf13/cobra/command.go:846 +0x30a github.com/openshift/origin/vendor/github.com/spf13/cobra.(*Command).Execute(0xc421054780, 0x2, 0xc421054780) /builddir/build/BUILD/atomic-openshift-git-0.c5fa1e4/_output/local/go/src/github.com/openshift/origin/vendor/github.com/spf13/cobra/command.go:794 +0x2b main.main() /builddir/build/BUILD/atomic-openshift-git-0.c5fa1e4/_output/local/go/src/github.com/openshift/origin/cmd/oc/oc.go:49 +0x365 Expected results: Shouldn't throw out panic Additional info:
Origin PR: https://github.com/openshift/origin/pull/20535
Waiting for puddle newer than v3.11.0-0.11.0.
Verified with oc v3.11.0-0.13.0 client $ oc set build-hook -f /tmp/emptyfile.json --post-commit=true --script=bundle\ exec\ rake\ test -n d54w3 error: no resources found
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:0407