refactor GetFakeSSLCert
This commit is contained in:
parent
4c37e0e4b7
commit
13a7e2c5d0
4 changed files with 40 additions and 38 deletions
|
|
@ -54,8 +54,6 @@ const (
|
|||
// High enough Burst to fit all expected use cases. Burst=0 is not set here, because
|
||||
// client code is overriding it.
|
||||
defaultBurst = 1e6
|
||||
|
||||
fakeCertificateName = "default-fake-certificate"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
@ -109,20 +107,8 @@ func main() {
|
|||
}
|
||||
}
|
||||
|
||||
// create the default SSL certificate (dummy)
|
||||
// TODO(elvinefendi) do this in a single function in ssl package
|
||||
defCert, defKey := ssl.GetFakeSSLCert()
|
||||
sslCert, err := ssl.CreateSSLCert(defCert, defKey)
|
||||
if err != nil {
|
||||
klog.Fatalf("unexpected error creating fake SSL Cert: %v", err)
|
||||
}
|
||||
err = ssl.StoreSSLCertOnDisk(fs, fakeCertificateName, sslCert)
|
||||
if err != nil {
|
||||
klog.Fatalf("unexpected error storing fake SSL Cert: %v", err)
|
||||
}
|
||||
conf.FakeCertificate = sslCert
|
||||
conf.FakeCertificate = ssl.GetFakeSSLCert(fs)
|
||||
klog.Infof("Created fake certificate with PemFileName: %v", conf.FakeCertificate.PemFileName)
|
||||
// end create default fake SSL certificates
|
||||
|
||||
conf.Client = kubeClient
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue