Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for PathsForCertAndKey (0.17 sec)

  1. cmd/kubeadm/app/phases/certs/renewal/readwriter.go

    		baseName:       baseName,
    		certificateDir: certificateDir,
    	}
    }
    
    // Exists checks if a certificate exist
    func (rw *pkiCertificateReadWriter) Exists() (bool, error) {
    	certificatePath, _ := pkiutil.PathsForCertAndKey(rw.certificateDir, rw.baseName)
    	return fileExists(certificatePath)
    }
    
    func fileExists(filename string) (bool, error) {
    	info, err := os.Stat(filename)
    	if err != nil {
    		if os.IsNotExist(err) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Apr 01 03:09:53 UTC 2024
    - 8.4K bytes
    - Viewed (0)
  2. cmd/kubeadm/app/util/pkiutil/pki_helpers.go

    	if err != nil {
    		return nil, errors.Wrapf(err, "could not load the CSR %s", csrPath)
    	}
    
    	return csr, nil
    }
    
    // PathsForCertAndKey returns the paths for the certificate and key given the path and basename.
    func PathsForCertAndKey(pkiPath, name string) (string, string) {
    	return pathForCert(pkiPath, name), pathForKey(pkiPath, name)
    }
    
    func pathForCert(pkiPath, name string) string {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 01 16:01:49 UTC 2024
    - 25.5K bytes
    - Viewed (0)
  3. cmd/kubeadm/app/phases/certs/renewal/readwriter_test.go

    	}
    
    	// Make sure that CA key is not present during Read() as it is not needed.
    	// This covers testing when the CA is external and not present on the host.
    	_, caKeyPath := pkiutil.PathsForCertAndKey(dirPKI, caName)
    	os.Remove(caKeyPath)
    
    	// Reads back the new certificate embedded in a kubeconfig writer
    	readCert, err = kubeconfigReadWriter.Read()
    	if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 30 15:17:24 UTC 2024
    - 9.5K bytes
    - Viewed (0)
  4. cmd/kubeadm/app/cmd/certs_test.go

    		})
    		return client, nil
    	}
    
    	// Select a certificate used to simulate a missing certificate file
    	brokenCertName := kubeadmconstants.APIServerCertAndKeyBaseName
    	brokenCertPath, _ := pkiutil.PathsForCertAndKey(cfg.CertificatesDir, brokenCertName)
    
    	type testCase struct {
    		name           string
    		config         string
    		output         string
    		brokenCertName string
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Feb 21 13:26:12 UTC 2024
    - 20.1K bytes
    - Viewed (0)
  5. cmd/kubeadm/app/util/pkiutil/pki_helpers_test.go

    					rt.expected,
    					(actual == nil),
    				)
    			}
    		})
    	}
    }
    
    func TestPathsForCertAndKey(t *testing.T) {
    	crtPath, keyPath := PathsForCertAndKey("/foo", "bar")
    	expectedPath := filepath.FromSlash("/foo/bar.crt")
    	if crtPath != expectedPath {
    		t.Errorf("unexpected certificate path: %s", crtPath)
    	}
    	expectedPath = filepath.FromSlash("/foo/bar.key")
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jan 31 21:49:21 UTC 2024
    - 22.5K bytes
    - Viewed (0)
Back to top