mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-29 21:29:24 +00:00
KEP-3325: Promote SelfSubjectReview to GA
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
This commit is contained in:
38
test/cmd/auth_whoami.sh
Executable file
38
test/cmd/auth_whoami.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright 2023 The Kubernetes Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
# Runs tests for kubectl diff
|
||||
run_kubectl_events_tests() {
|
||||
set -o nounset
|
||||
set -o errexit
|
||||
|
||||
create_and_use_new_namespace
|
||||
kube::log::status "Testing kubectl auth whoami"
|
||||
|
||||
### Create a new namespace
|
||||
# Command
|
||||
output_message=$(kubectl auth whoami -o json 2>&1)
|
||||
|
||||
# Post-condition: should return user attributes.
|
||||
kube::test::if_has_string "${output_message}" '"kind": "SelfSubjectReview"'
|
||||
|
||||
set +o nounset
|
||||
set +o errexit
|
||||
}
|
||||
Reference in New Issue
Block a user