Skip to content

Commit

Permalink
🐛 stop using hardcoded temp dir
Browse files Browse the repository at this point in the history
We now use https://golang.org/pkg/os/#TempDir to get the os specific
temp dir. Otherwise, it won't work for Windows users.
  • Loading branch information
Mengqi Yu committed Jul 22, 2019
1 parent 8f633b1 commit 90c83df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/webhook/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"fmt"
"net"
"net/http"
"os"
"path"
"path/filepath"
"strconv"
Expand Down Expand Up @@ -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")
}
}

Expand Down

0 comments on commit 90c83df

Please sign in to comment.