From 081cf49671f4c751dacb151f18c0c5748a36a7bf Mon Sep 17 00:00:00 2001 From: Zhou Hao Date: Thu, 11 Oct 2018 09:16:48 +0800 Subject: [PATCH] certs: Delete useless code Signed-off-by: Zhou Hao --- cmd/kubeadm/app/phases/certs/certs.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/cmd/kubeadm/app/phases/certs/certs.go b/cmd/kubeadm/app/phases/certs/certs.go index 9119ef1899f..4f71ca271c4 100644 --- a/cmd/kubeadm/app/phases/certs/certs.go +++ b/cmd/kubeadm/app/phases/certs/certs.go @@ -145,19 +145,6 @@ func CreateCertAndKeyFilesWithCA(certSpec *KubeadmCert, caCertSpec *KubeadmCert, return certSpec.CreateFromCA(cfg, caCert, caKey) } -func newCertAndKeyFromSpec(certSpec *KubeadmCert, cfg *kubeadmapi.InitConfiguration, caCert *x509.Certificate, caKey *rsa.PrivateKey) (*x509.Certificate, *rsa.PrivateKey, error) { - certConfig, err := certSpec.GetConfig(cfg) - if err != nil { - return nil, nil, fmt.Errorf("failure while creating certificate %s: %v", certSpec.Name, err) - } - cert, key, err := pkiutil.NewCertAndKey(caCert, caKey, certConfig) - if err != nil { - return nil, nil, fmt.Errorf("failure while creating %s key and certificate: %v", certSpec.Name, err) - } - - return cert, key, err -} - // LoadCertificateAuthority tries to load a CA in the given directory with the given name. func LoadCertificateAuthority(pkiDir string, baseName string) (*x509.Certificate, *rsa.PrivateKey, error) { // Checks if certificate authority exists in the PKI directory