File tree Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
+
3
+ POSITIONAL=()
4
+ CONTEXT=" "
5
+ KUBECOFIG=" "
6
+ while [[ $# -gt 0 ]]
7
+ do
8
+ key=" $1 "
9
+
10
+ case $key in
11
+ --context)
12
+ CONTEXT=" --context $2 "
13
+ shift
14
+ shift
15
+ ;;
16
+ --kubeconfig)
17
+ KUBECONFIG=" --kubconfig $2 "
18
+ shift
19
+ shift
20
+ ;;
21
+ * )
22
+ POSITIONAL+=(" $1 " ) # save it in an array for later
23
+ shift # past argument
24
+ ;;
25
+ esac
26
+ done
27
+ set -- " ${POSITIONAL[@]} " # restore positional parameters
28
+
2
29
if [ -z " $1 " ]; then
3
30
echo " Please specify node name"
4
31
exit 1
36
63
) "
37
64
38
65
echo " spawning \" $POD \" on \" $NODE \" "
39
- kubectl run --namespace " $NAMESPACE " --rm --image alpine --overrides=" $OVERRIDES " --generator=run-pod/v1 -ti " $POD "
66
+ kubectl run --namespace " $NAMESPACE " --rm --image alpine --overrides=" $OVERRIDES " --generator=run-pod/v1 -ti " $POD " $CONTEXT $KUBECONFIG
You can’t perform that action at this time.
0 commit comments