mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00: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
@ -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 New Issue
Block a user