only output "No resources found." for human readable printers

This commit is contained in:
juanvallejo
2017-01-26 15:54:27 -05:00
parent 9ea9480650
commit 5ec2a4c3ca
3 changed files with 59 additions and 4 deletions

View File

@@ -224,7 +224,7 @@ kube::test::if_has_string() {
local message=$1
local match=$2
if [[ $(echo "$message" | grep "$match") ]]; then
if echo "$message" | grep -q "$match"; then
echo "Successful"
echo "message:$message"
echo "has:$match"
@@ -238,6 +238,24 @@ kube::test::if_has_string() {
fi
}
kube::test::if_has_not_string() {
local message=$1
local match=$2
if echo "$message" | grep -q "$match"; then
echo "FAIL!"
echo "message:$message"
echo "has:$match"
caller
return 1
else
echo "Successful"
echo "message:$message"
echo "has not:$match"
return 0
fi
}
# Returns true if the required resource is part of supported resources.
# Expects env vars:
# SUPPORTED_RESOURCES: Array of all resources supported by the apiserver. "*"