mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Merge pull request #81447 from tariq1890/fix_nil
[kubernetes/kubeadm] fix minor nil issues in kudeadm code
This commit is contained in:
		@@ -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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user