Skip to content
This repository was archived by the owner on Jan 29, 2025. It is now read-only.

Commit 560c799

Browse files
killianmuldoontogashidm
authored andcommitted
Remove symlink check for cert files on extender start
Kubernetes loads volumes, including certs etc., and stores them as versioned symlinks for file updates and rotation. The TAS extender originally sought to check for symlinks and error out if the certs were not hard links. A bug in the implementation allowed the cert links to pass through undetected. This change removes the symlink check as any proper symlink checking in TAS is likely to be too implementation specific and TAS requires symlinks to load certs.
1 parent 5feeba4 commit 560c799

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

extender/scheduler.go

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"io/ioutil"
88
"log"
99
"net/http"
10-
"os"
1110
"time"
1211
)
1312

@@ -78,18 +77,6 @@ func errorHandler(w http.ResponseWriter, r *http.Request) {
7877
w.WriteHeader(http.StatusNotFound)
7978
}
8079

81-
//Check symlinks checks if a file is a simlink and returns an error if it is.
82-
func checkSymLinks(filename string) error {
83-
info, err := os.Lstat(filename)
84-
if err != nil {
85-
return err
86-
}
87-
if info.Mode() == os.ModeSymlink {
88-
return err
89-
}
90-
return nil
91-
}
92-
9380
// StartServer starts the HTTP server needed for the scheduler extender.
9481
// It registers the handlers and checks for existing telemetry policies.
9582
func (m Server) StartServer(port string, certFile string, keyFile string, caFile string, unsafe bool) {
@@ -102,18 +89,6 @@ func (m Server) StartServer(port string, certFile string, keyFile string, caFile
10289
log.Printf("Extender Listening on HTTP %v", port)
10390
err = http.ListenAndServe(":"+port, mx)
10491
} else {
105-
err := checkSymLinks(certFile)
106-
if err != nil {
107-
panic(err)
108-
}
109-
err = checkSymLinks(keyFile)
110-
if err != nil {
111-
panic(err)
112-
}
113-
err = checkSymLinks(caFile)
114-
if err != nil {
115-
panic(err)
116-
}
11792
log.Printf("Extender Now Listening on HTTPS %v", port)
11893
srv := configureSecureServer(port, caFile)
11994
srv.Handler = mx

0 commit comments

Comments
 (0)