Skip to content

Commit

Permalink
removed few unnecessary caCert lines
Browse files Browse the repository at this point in the history
  • Loading branch information
Suraj Narwade committed Aug 26, 2020
1 parent 505a261 commit 193fbfc
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions vertical-pod-autoscaler/pkg/admission-controller/certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ func NewKeypairReloader(config certsConfig) (*KeypairReloader, error) {
result := &KeypairReloader{
certPath: *config.tlsCertFile,
keyPath: *config.tlsPrivateKey,
caPath: *config.clientCaFile,
caCert: readFile(*config.clientCaFile),
}
cert, err := tls.LoadX509KeyPair(*config.tlsCertFile, *config.tlsPrivateKey)
Expand Down Expand Up @@ -99,7 +98,7 @@ func NewKeypairReloader(config certsConfig) (*KeypairReloader, error) {

// watch for errors
case err := <-watcher.Errors:
klog.Infof("error", err)
klog.Infof("error: %v", err)
}
}
}()
Expand All @@ -110,14 +109,12 @@ func NewKeypairReloader(config certsConfig) (*KeypairReloader, error) {
// reload loads updated cert and key whenever they are updated
func (kpr *KeypairReloader) reload() error {
newCert, err := tls.LoadX509KeyPair(kpr.certPath, kpr.keyPath)
caCert := readFile(kpr.caPath)
if err != nil {
return err
}
kpr.certMu.Lock()
defer kpr.certMu.Unlock()
kpr.cert = &newCert
kpr.caCert = caCert
return nil
}

Expand Down

0 comments on commit 193fbfc

Please sign in to comment.