File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -4,10 +4,29 @@ USERNAME=`id -un`
44cd ~ /.kube
55mkdir -p keys
66
7- profile=$( minikube profile list -o json | jq ' .valid' | jq -r ' .[].Name' )
7+ profiles=$( minikube profile list -o json | jq -r ' .valid | .[] | select(.Status=="Running") | .Name' )
8+
9+ profiles_count=$( echo " $profiles " | wc -l | tr -d ' [:space:]' )
10+
11+ if [ " $profiles_count " != 1 ]; then
12+ options=($profiles )
13+ echo " Select running cluster you want to copy files from?"
14+ select opt in " ${options[@]} "
15+ do
16+ profile_name=$opt
17+ if [ " $profile_name " == " " ]; then
18+ echo " Wrong option"
19+ continue
20+ fi
21+ break
22+ done
23+ else
24+ profile_name=$profiles
25+ fi
26+
827cp /Users/${USERNAME} /.minikube/ca.crt keys/
9- cp /Users/${USERNAME} /.minikube/profiles/$profile /client.crt keys/
10- cp /Users/${USERNAME} /.minikube/profiles/$profile /client.key keys/
28+ cp /Users/${USERNAME} /.minikube/profiles/$profile_name /client.crt keys/
29+ cp /Users/${USERNAME} /.minikube/profiles/$profile_name /client.key keys/
1130
1231gsed -i " s/\/Users\/${USERNAME} \/.minikube\/profiles\/minikube/.\/keys/g" config
1332gsed -i " s/\/Users\/${USERNAME} \/.minikube/.\/keys/g" config
You can’t perform that action at this time.
0 commit comments