Skip to content

Commit

Permalink
fix(k8s): skip setMinikubeDockerEnv when vm-driver=None
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-kpyc committed Jul 4, 2019
1 parent 0d195fa commit 8ffbe81
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions garden-service/src/plugins/kubernetes/local/minikube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,15 @@ import * as execa from "execa"
* Automatically set docker environment variables for minikube
* TODO: it would be better to explicitly provide those to docker instead of using process.env
*/
export async function setMinikubeDockerEnv() {
const minikubeEnv = await execa.stdout("minikube", ["docker-env", "--shell=bash"])
export async function setMinikubeDockerEnv() {
try {
const minikubeEnv = await execa.stdout("minikube", ["docker-env", "--shell=bash"])
} catch (err) {
if (err.contains("driver does not support")) {
return;
}
throw err;
}
for (const line of minikubeEnv.split("\n")) {
const matched = line.match(/^export (\w+)="(.+)"$/)
if (matched) {
Expand Down

0 comments on commit 8ffbe81

Please sign in to comment.