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 23, 2019
1 parent 86ffaff commit d4d6a51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/webhook/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"fmt"
"net"
"net/http"
"path"
"os"
"path/filepath"
"strconv"
"sync"
Expand Down Expand Up @@ -85,7 +85,7 @@ func (s *Server) setDefaults() {
}

if len(s.CertDir) == 0 {
s.CertDir = path.Join("/tmp", "k8s-webhook-server", "serving-certs")
s.CertDir = filepath.Join(os.TempDir(), "k8s-webhook-server", "serving-certs")
}
}

Expand Down

0 comments on commit d4d6a51

Please sign in to comment.