Skip to content

Commit

Permalink
fix. prevent skipping CRD
Browse files Browse the repository at this point in the history
  • Loading branch information
pymag09 committed May 21, 2024
1 parent 1052f9c commit 9aea06d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kubecui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ __get_events_all__(){
__normalize_resource_data() {
local word="$1"

if [[ $word =~ \. ]]; then
echo "$word"
return 0
fi
while read -r plural short _; do
if [ "$word" == "$plural" ] || [ "$word" == "$short" ] || [ "$word" == "$(echo "$plural" | sed -r 's/s$//')" ] || [ "$word" == "$(echo "$plural" | sed -r 's/e?s$//')" ]; then
echo "$plural"
Expand All @@ -114,7 +118,7 @@ __normalize_resource_data() {
}

k() {
OBJ=$(__normalize_resource_data $(echo "$@" | sed -E 's/^.*get[[:space:]]([[:alnum:]]+[[:space:]]?[[:lower:]]+[-0-9[:lower:]]*)[[:space:]]?(-)?.*$/\1/'))
OBJ=$(__normalize_resource_data $(echo "$@" | sed -E 's/^.*get[[:space:]]([[:alnum:]]+[[:space:]]?[[:lower:]]+[-0-9.[:lower:]]*)[[:space:]]?(-)?.*$/\1/'))
case "$@" in
"config use-context" ) kubectl config use-context $(kubectl config get-contexts | fzf --layout=reverse --header-lines=1 | sed 's/^\**\s*\([a-z\-]*\).*/\1/');;

Expand Down

0 comments on commit 9aea06d

Please sign in to comment.