mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-06-09 08:55:55 -04:00
Merge pull request #81447 from tariq1890/fix_nil
[kubernetes/kubeadm] fix minor nil issues in kudeadm code
This commit is contained in:
commit
117e83157b
2 changed files with 2 additions and 3 deletions
|
|
@ -204,7 +204,7 @@ func getDataFromDisk(cfg *kubeadmapi.InitConfiguration, key []byte) (map[string]
|
|||
secretData := map[string][]byte{}
|
||||
for certName, certPath := range certsToTransfer(cfg) {
|
||||
cert, err := loadAndEncryptCert(certPath, key)
|
||||
if err == nil || (err != nil && os.IsNotExist(err)) {
|
||||
if err == nil || os.IsNotExist(err) {
|
||||
secretData[certOrKeyNameToSecretName(certName)] = cert
|
||||
} else {
|
||||
return nil, err
|
||||
|
|
|
|||
|
|
@ -480,8 +480,7 @@ func parseCSRPEM(pemCSR []byte) (*x509.CertificateRequest, error) {
|
|||
}
|
||||
|
||||
if block.Type != certutil.CertificateRequestBlockType {
|
||||
var block *pem.Block
|
||||
return nil, errors.Errorf("expected block type %q, but PEM had type %v", certutil.CertificateRequestBlockType, block.Type)
|
||||
return nil, errors.Errorf("expected block type %q, but PEM had type %q", certutil.CertificateRequestBlockType, block.Type)
|
||||
}
|
||||
|
||||
return x509.ParseCertificateRequest(block.Bytes)
|
||||
|
|
|
|||
Loading…
Reference in a new issue