Skip to content

Commit

Permalink
added can-i
Browse files Browse the repository at this point in the history
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
  • Loading branch information
ivankatliarchuk committed Sep 25, 2023
1 parent f8e4f32 commit 3b3450c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions shell/aliase/kube
Original file line number Diff line number Diff line change
Expand Up @@ -1135,3 +1135,14 @@ function k.getnames {
# --show-kind is optional
kubectl get "${NAMES:0:-1}" --show-kind
}

function k.can-i {
# kubectl auth can-i delete pods -n=apps-plm --as-group=hbi:team:composer-platform --as=team-composer
# VERB [TYPE | TYPE/NAME | NONRESOURCEURL] [options]
local verb=$1 # e.g. list/delete
local type=$2 # e.g. pods/logs
local namespace=$3
local group=$4
local user=$5
kubectl auth can-i $verb $type -n=$namespace --as-group=$group --as=$user
}

0 comments on commit 3b3450c

Please sign in to comment.