add a warning printer in cli-runtime to coordinate warning style

modified:   staging/src/k8s.io/kubectl/pkg/cmd/auth/auth.go
This commit is contained in:
jlsong01
2022-02-18 20:33:38 +08:00
parent e7a2ce75e5
commit 272e245f06
13 changed files with 118 additions and 27 deletions

View File

@@ -41,7 +41,7 @@ run_clusterroles_tests() {
kubectl create "${kube_flags[@]:?}" clusterrole pod-admin --verb=* --resource=pods
kube::test::get_object_assert clusterrole/pod-admin "{{range.rules}}{{range.verbs}}{{.}}:{{end}}{{end}}" '\*:'
output_message=$(kubectl delete clusterrole pod-admin -n test 2>&1 "${kube_flags[@]}")
kube::test::if_has_string "${output_message}" 'warning: deleting cluster-scoped resources'
kube::test::if_has_string "${output_message}" 'Warning: deleting cluster-scoped resources'
kube::test::if_has_string "${output_message}" 'clusterrole.rbac.authorization.k8s.io "pod-admin" deleted'
kubectl create "${kube_flags[@]}" clusterrole pod-admin --verb=* --resource=pods