From 90c83df68bb78d8d0f2576da403da859911e1f16 Mon Sep 17 00:00:00 2001 From: Mengqi Yu Date: Mon, 22 Jul 2019 16:23:56 -0700 Subject: [PATCH] :bug: stop using hardcoded temp dir We now use https://golang.org/pkg/os/#TempDir to get the os specific temp dir. Otherwise, it won't work for Windows users. --- pkg/webhook/server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/webhook/server.go b/pkg/webhook/server.go index 68a8e7dd65..816ebbcf4a 100644 --- a/pkg/webhook/server.go +++ b/pkg/webhook/server.go @@ -22,6 +22,7 @@ import ( "fmt" "net" "net/http" + "os" "path" "path/filepath" "strconv" @@ -85,7 +86,7 @@ func (s *Server) setDefaults() { } if len(s.CertDir) == 0 { - s.CertDir = path.Join("/tmp", "k8s-webhook-server", "serving-certs") + s.CertDir = path.Join(os.TempDir(), "k8s-webhook-server", "serving-certs") } }