Adds support to a tree hierarchy of kubectl plugins
This commit is contained in:
@@ -3769,6 +3769,21 @@ __EOF__
|
||||
output_message=$(! KUBECTL_PLUGINS_PATH=test/fixtures/pkg/kubectl/plugins/ kubectl plugin error 2>&1)
|
||||
kube::test::if_has_string "${output_message}" 'error: exit status 1'
|
||||
|
||||
# plugin tree
|
||||
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}" '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}" 'child3\s\+The third child of a tree'
|
||||
output_message=$(KUBECTL_PLUGINS_PATH=test/fixtures/pkg/kubectl/plugins kubectl plugin tree child1 --help 2>&1)
|
||||
kube::test::if_has_string "${output_message}" 'The first child of a tree'
|
||||
kube::test::if_has_not_string "${output_message}" 'The second child'
|
||||
kube::test::if_has_not_string "${output_message}" 'child2'
|
||||
output_message=$(KUBECTL_PLUGINS_PATH=test/fixtures/pkg/kubectl/plugins kubectl plugin tree child1 2>&1)
|
||||
kube::test::if_has_string "${output_message}" 'child one'
|
||||
kube::test::if_has_not_string "${output_message}" 'child1'
|
||||
kube::test::if_has_not_string "${output_message}" 'The first child'
|
||||
|
||||
#################
|
||||
# Impersonation #
|
||||
#################
|
||||
|
Reference in New Issue
Block a user