mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
Merge pull request #50500 from shiywang/sortby
Automatic merge from submit-queue (batch tested with PRs 50302, 50573, 50500, 50633, 50617) add cmd-test for sort-by command this follow up : https://github.com/kubernetes/kubernetes/pull/48659 /assign @pwittrock as your suggestion, cmd-test added, ptal ```release-note NONE ```
This commit is contained in:
@@ -250,6 +250,17 @@ kube::test::describe_resource_events_assert() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Compare sort-by resource name output with expected order specify in the last parameter
|
||||
kube::test::if_sort_by_has_correct_order() {
|
||||
local array=($(echo "$1" |awk '{if(NR!=1) print $1}'))
|
||||
local var
|
||||
for i in "${array[@]}"; do
|
||||
var+="$i:"
|
||||
done
|
||||
|
||||
kube::test::if_has_string "$var" "${@:$#}"
|
||||
}
|
||||
|
||||
kube::test::if_has_string() {
|
||||
local message=$1
|
||||
local match=$2
|
||||
|
||||
Reference in New Issue
Block a user