File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ container_cpu="${KUBECTL_NODE_SHELL_POD_CPU:-100m}"
1111container_memory=" ${KUBECTL_NODE_SHELL_POD_MEMORY:- 256Mi} "
1212volumes=" []"
1313volume_mounts=" []"
14- x_mode=0
14+ x_mode=false
1515labels=" ${KUBECTL_NODE_SHELL_LABELS} "
1616pod_running_timeout=" ${KUBECTL_NODE_SHELL_POD_RUNNING_TIMEOUT:- 1m} "
1717image_pull_secret_name=" ${KUBECTL_NODE_SHELL_IMAGE_PULL_SECRET_NAME} "
@@ -73,7 +73,7 @@ while [ $# -gt 0 ]; do
7373 shift
7474 ;;
7575 -x)
76- x_mode=1
76+ x_mode=true
7777 volumes=$( echo " $volumes " | jq ' . += [{"hostPath": {"path": "/", "type": ""}, "name": "host-root"}]' )
7878 volume_mounts=$( echo " $volume_mounts " | jq ' . += [{"mountPath":"/host","name":"host-root"}]' )
7979 shift
173173
174174# Build the container command
175175if [ $# -gt 0 ]; then
176- if [ " $x_mode " -eq 1 ]; then
176+ if [ " $x_mode " = true ]; then
177177 cmd=' ['
178178 else
179179 cmd=" [ $cmd_start $cmd_arg_prefix ,"
@@ -188,7 +188,7 @@ if [ $# -gt 0 ]; then
188188 done
189189 cmd=" $cmd ]"
190190else
191- if [ " $x_mode " = 1 ]; then
191+ if [ " $x_mode " = true ]; then
192192 cmd=' null'
193193 else
194194 cmd=" [ $cmd_start $cmd_default ]"
@@ -213,8 +213,9 @@ cat <<EOT
213213{
214214 "spec": {
215215 "nodeName": "$node ",
216- "hostPID": true,
217- "hostNetwork": true,
216+ "hostPID": $use_pid ,
217+ "hostIPC": $use_ipc ,
218+ "hostNetwork": $use_net ,
218219 "imagePullSecrets": $image_pull_secrets ,
219220 "containers": [
220221 {
You can’t perform that action at this time.
0 commit comments