Skip to content

Commit 90c83df

Browse files
author
Mengqi Yu
committed
🐛 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.
1 parent 8f633b1 commit 90c83df

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/webhook/server.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"fmt"
2323
"net"
2424
"net/http"
25+
"os"
2526
"path"
2627
"path/filepath"
2728
"strconv"
@@ -85,7 +86,7 @@ func (s *Server) setDefaults() {
8586
}
8687

8788
if len(s.CertDir) == 0 {
88-
s.CertDir = path.Join("/tmp", "k8s-webhook-server", "serving-certs")
89+
s.CertDir = path.Join(os.TempDir(), "k8s-webhook-server", "serving-certs")
8990
}
9091
}
9192

0 commit comments

Comments
 (0)