mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-03 18:27:49 +00:00
only output "No resources found." for human readable printers
This commit is contained in:
@@ -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. "*"
|
||||
|
Reference in New Issue
Block a user