From aa6a693142cd062840dc42af3d3c7d66ad026ff1 Mon Sep 17 00:00:00 2001 From: Ilya Zuyev Date: Mon, 9 Nov 2020 13:44:52 -0800 Subject: [PATCH] Fix unit tests for "[docker|podman]-env --unset" --- cmd/minikube/cmd/docker-env_test.go | 49 +++++++++++++++++++++++------ cmd/minikube/cmd/podman-env_test.go | 3 +- 2 files changed, 42 insertions(+), 10 deletions(-) diff --git a/cmd/minikube/cmd/docker-env_test.go b/cmd/minikube/cmd/docker-env_test.go index aaa1d97f5b..d34e51213e 100644 --- a/cmd/minikube/cmd/docker-env_test.go +++ b/cmd/minikube/cmd/docker-env_test.go @@ -52,7 +52,10 @@ export MINIKUBE_ACTIVE_DOCKERD="dockerdriver" # To point your shell to minikube's docker-daemon, run: # eval $(minikube -p dockerdriver docker-env) `, - `unset DOCKER_TLS_VERIFY DOCKER_HOST DOCKER_CERT_PATH MINIKUBE_ACTIVE_DOCKERD + `unset DOCKER_TLS_VERIFY; +unset DOCKER_HOST; +unset DOCKER_CERT_PATH; +unset MINIKUBE_ACTIVE_DOCKERD; `, }, { @@ -67,7 +70,10 @@ export MINIKUBE_ACTIVE_DOCKERD="bash" # To point your shell to minikube's docker-daemon, run: # eval $(minikube -p bash docker-env) `, - `unset DOCKER_TLS_VERIFY DOCKER_HOST DOCKER_CERT_PATH MINIKUBE_ACTIVE_DOCKERD + `unset DOCKER_TLS_VERIFY; +unset DOCKER_HOST; +unset DOCKER_CERT_PATH; +unset MINIKUBE_ACTIVE_DOCKERD; `, }, { @@ -82,7 +88,10 @@ export MINIKUBE_ACTIVE_DOCKERD="ipv6" # To point your shell to minikube's docker-daemon, run: # eval $(minikube -p ipv6 docker-env) `, - `unset DOCKER_TLS_VERIFY DOCKER_HOST DOCKER_CERT_PATH MINIKUBE_ACTIVE_DOCKERD + `unset DOCKER_TLS_VERIFY; +unset DOCKER_HOST; +unset DOCKER_CERT_PATH; +unset MINIKUBE_ACTIVE_DOCKERD; `, }, { @@ -115,7 +124,10 @@ $Env:MINIKUBE_ACTIVE_DOCKERD = "powershell" # & minikube -p powershell docker-env | Invoke-Expression `, - `Remove-Item Env:\\DOCKER_TLS_VERIFY Env:\\DOCKER_HOST Env:\\DOCKER_CERT_PATH Env:\\MINIKUBE_ACTIVE_DOCKERD + `Remove-Item Env:\\DOCKER_TLS_VERIFY +Remove-Item Env:\\DOCKER_HOST +Remove-Item Env:\\DOCKER_CERT_PATH +Remove-Item Env:\\MINIKUBE_ACTIVE_DOCKERD `, }, { @@ -167,7 +179,11 @@ export NO_PROXY="127.0.0.1" # eval $(minikube -p bash-no-proxy docker-env) `, - `unset DOCKER_TLS_VERIFY DOCKER_HOST DOCKER_CERT_PATH MINIKUBE_ACTIVE_DOCKERD NO_PROXY + `unset DOCKER_TLS_VERIFY; +unset DOCKER_HOST; +unset DOCKER_CERT_PATH; +unset MINIKUBE_ACTIVE_DOCKERD; +unset NO_PROXY; `, }, { @@ -184,7 +200,11 @@ export no_proxy="127.0.0.1" # eval $(minikube -p bash-no-proxy-lower docker-env) `, - `unset DOCKER_TLS_VERIFY DOCKER_HOST DOCKER_CERT_PATH MINIKUBE_ACTIVE_DOCKERD no_proxy + `unset DOCKER_TLS_VERIFY; +unset DOCKER_HOST; +unset DOCKER_CERT_PATH; +unset MINIKUBE_ACTIVE_DOCKERD; +unset no_proxy; `, }, { @@ -200,7 +220,11 @@ $Env:no_proxy = "192.168.0.1" # & minikube -p powershell-no-proxy-idempotent docker-env | Invoke-Expression `, - `Remove-Item Env:\\DOCKER_TLS_VERIFY Env:\\DOCKER_HOST Env:\\DOCKER_CERT_PATH Env:\\MINIKUBE_ACTIVE_DOCKERD Env:\\no_proxy + `Remove-Item Env:\\DOCKER_TLS_VERIFY +Remove-Item Env:\\DOCKER_HOST +Remove-Item Env:\\DOCKER_CERT_PATH +Remove-Item Env:\\MINIKUBE_ACTIVE_DOCKERD +Remove-Item Env:\\no_proxy `, }, { @@ -217,7 +241,11 @@ export NO_PROXY="192.168.0.1,10.0.0.4,127.0.0.1" # eval $(minikube -p sh-no-proxy-add docker-env) `, - `unset DOCKER_TLS_VERIFY DOCKER_HOST DOCKER_CERT_PATH MINIKUBE_ACTIVE_DOCKERD NO_PROXY + `unset DOCKER_TLS_VERIFY; +unset DOCKER_HOST; +unset DOCKER_CERT_PATH; +unset MINIKUBE_ACTIVE_DOCKERD; +unset NO_PROXY; `, }, { @@ -229,7 +257,10 @@ DOCKER_HOST=tcp://127.0.0.1:32842 DOCKER_CERT_PATH=/certs MINIKUBE_ACTIVE_DOCKERD=noneshell `, - `DOCKER_TLS_VERIFY DOCKER_HOST DOCKER_CERT_PATH MINIKUBE_ACTIVE_DOCKERD + `DOCKER_TLS_VERIFY +DOCKER_HOST +DOCKER_CERT_PATH +MINIKUBE_ACTIVE_DOCKERD `, }, } diff --git a/cmd/minikube/cmd/podman-env_test.go b/cmd/minikube/cmd/podman-env_test.go index 088867193a..8cfb7a8641 100644 --- a/cmd/minikube/cmd/podman-env_test.go +++ b/cmd/minikube/cmd/podman-env_test.go @@ -49,7 +49,8 @@ export MINIKUBE_ACTIVE_PODMAN="bash" # To point your shell to minikube's podman service, run: # eval $(minikube -p bash podman-env) `, - `unset PODMAN_VARLINK_BRIDGE MINIKUBE_ACTIVE_PODMAN + `unset PODMAN_VARLINK_BRIDGE; +unset MINIKUBE_ACTIVE_PODMAN; `, }, }