From 6f7fd002abb5f6f23e4fd3f8a5a369168d86cfe1 Mon Sep 17 00:00:00 2001 From: dlorenc Date: Tue, 7 Nov 2017 08:51:09 -0800 Subject: [PATCH] More storage provisioner fixes. I'm not sure of a better way to ensure /tmp exists in a from scratch container, but glog appears to just explode without it. --- Makefile | 2 +- cmd/storage-provisioner/main.go | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0b4c3f4ad3..27e83d77ad 100755 --- a/Makefile +++ b/Makefile @@ -301,7 +301,7 @@ $(ISO_BUILD_IMAGE): deploy/iso/minikube-iso/Dockerfile @echo "$(@) successfully built" out/storage-provisioner: $(shell $(STORAGE_PROVISIONER_FILES)) - go build GOOS=linux -o $(BUILD_DIR)/storage-provisioner -ldflags=$(LOCALKUBE_LDFLAGS) cmd/storage-provisioner/main.go + GOOS=linux go build -o $(BUILD_DIR)/storage-provisioner -ldflags=$(LOCALKUBE_LDFLAGS) cmd/storage-provisioner/main.go .PHONY: storage-provisioner-image storage-provisioner-image: out/storage-provisioner diff --git a/cmd/storage-provisioner/main.go b/cmd/storage-provisioner/main.go index ac08d4ae73..63193a15ba 100644 --- a/cmd/storage-provisioner/main.go +++ b/cmd/storage-provisioner/main.go @@ -18,11 +18,19 @@ package main import ( "flag" + "fmt" + "os" + "github.com/golang/glog" "k8s.io/minikube/pkg/localkube" ) func main() { + // Glog requires that /tmp exists. + if err := os.MkdirAll("/tmp", 0755); err != nil { + fmt.Printf("Error creating tmpdir: %s\n", err) + os.Exit(1) + } flag.Parse() if err := localkube.StartStorageProvisioner(); err != nil {