mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 18:00:08 +00:00
fix return 0 error in DefaultSubCommandRun
This commit is contained in:
parent
e821e531db
commit
87abe13022
@ -4188,7 +4188,7 @@ run_plugins_tests() {
|
|||||||
kube::test::if_has_string "${output_message}" 'no plugins installed'
|
kube::test::if_has_string "${output_message}" 'no plugins installed'
|
||||||
|
|
||||||
# single plugins path
|
# single plugins path
|
||||||
output_message=$(KUBECTL_PLUGINS_PATH=test/fixtures/pkg/kubectl/plugins kubectl plugin 2>&1)
|
output_message=$(! KUBECTL_PLUGINS_PATH=test/fixtures/pkg/kubectl/plugins kubectl plugin 2>&1)
|
||||||
kube::test::if_has_string "${output_message}" 'echo\s\+Echoes for test-cmd'
|
kube::test::if_has_string "${output_message}" 'echo\s\+Echoes for test-cmd'
|
||||||
kube::test::if_has_string "${output_message}" 'get\s\+The wonderful new plugin-based get!'
|
kube::test::if_has_string "${output_message}" 'get\s\+The wonderful new plugin-based get!'
|
||||||
kube::test::if_has_string "${output_message}" 'error\s\+The tremendous plugin that always fails!'
|
kube::test::if_has_string "${output_message}" 'error\s\+The tremendous plugin that always fails!'
|
||||||
@ -4225,7 +4225,7 @@ run_plugins_tests() {
|
|||||||
kube::test::if_has_string "${output_message}" 'error: exit status 1'
|
kube::test::if_has_string "${output_message}" 'error: exit status 1'
|
||||||
|
|
||||||
# plugin tree
|
# plugin tree
|
||||||
output_message=$(KUBECTL_PLUGINS_PATH=test/fixtures/pkg/kubectl/plugins kubectl plugin tree 2>&1)
|
output_message=$(! KUBECTL_PLUGINS_PATH=test/fixtures/pkg/kubectl/plugins kubectl plugin tree 2>&1)
|
||||||
kube::test::if_has_string "${output_message}" 'Plugin with a tree of commands'
|
kube::test::if_has_string "${output_message}" 'Plugin with a tree of commands'
|
||||||
kube::test::if_has_string "${output_message}" 'child1\s\+The first child of a tree'
|
kube::test::if_has_string "${output_message}" 'child1\s\+The first child of a tree'
|
||||||
kube::test::if_has_string "${output_message}" 'child2\s\+The second child of a tree'
|
kube::test::if_has_string "${output_message}" 'child2\s\+The second child of a tree'
|
||||||
|
@ -778,6 +778,7 @@ func DefaultSubCommandRun(out io.Writer) func(c *cobra.Command, args []string) {
|
|||||||
c.SetOutput(out)
|
c.SetOutput(out)
|
||||||
RequireNoArguments(c, args)
|
RequireNoArguments(c, args)
|
||||||
c.Help()
|
c.Help()
|
||||||
|
CheckErr(ErrExit)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user