use RANDDOM var instead of shuf command to avoid dep issue, shorten code
This commit is contained in:
parent
a494958402
commit
e05b6b911d
11
zsh/k8s.zsh
11
zsh/k8s.zsh
@ -64,14 +64,9 @@ function getpod {
|
|||||||
echo "Pod not found for $PROJECT"
|
echo "Pod not found for $PROJECT"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
if [[ $RAN == 'true' ]];then
|
RUNNING_POD_INDEX=$(($RANDOM % ${#RUNNING_PODS[@]} + 1))
|
||||||
RUNNING_POD_INDEX=`shuf -i 1-${#RUNNING_PODS[@]} -n 1`
|
[[ $RAN == 'true' ]] && break
|
||||||
break
|
if [ ${#RUNNING_PODS[@]} -gt 1 ];then
|
||||||
fi
|
|
||||||
if [ ${#RUNNING_PODS[@]} -eq 1 ];then
|
|
||||||
RUNNING_POD_INDEX=1
|
|
||||||
break
|
|
||||||
elif [ ${#RUNNING_PODS[@]} -gt 1 ];then
|
|
||||||
echo $fg[green]'Running Pods:'$reset_color
|
echo $fg[green]'Running Pods:'$reset_color
|
||||||
INDEX=1
|
INDEX=1
|
||||||
for i in $RUNNING_PODS;do
|
for i in $RUNNING_PODS;do
|
||||||
|
Loading…
Reference in New Issue
Block a user