- Sort Score
- Result 10 results
- Languages All
Results 1 - 7 of 7 for TryLoadCertAndKeyFromDisk (0.37 sec)
-
cmd/kubeadm/app/util/pkiutil/pki_helpers_test.go
name: "foo", expected: true, }, } for _, rt := range tests { t.Run(rt.desc, func(t *testing.T) { _, _, actual := TryLoadCertAndKeyFromDisk(rt.path, rt.name) if (actual == nil) != rt.expected { t.Errorf( "failed TryLoadCertAndKeyFromDisk:\n\texpected: %t\n\t actual: %t", rt.expected, (actual == nil), ) } }) } }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed Jan 31 21:49:21 UTC 2024 - 22.5K bytes - Viewed (0) -
cmd/kubeadm/app/cmd/kubeconfig_test.go
// Adds a pki folder with a ca cert to the temp folder pkidir := testutil.SetupPkiDirWithCertificateAuthority(t, tmpdir) // Retrieves ca cert for assertions caCert, _, err := pkiutil.TryLoadCertAndKeyFromDisk(pkidir, kubeadmconstants.CACertAndKeyBaseName) if err != nil { t.Fatalf("couldn't retrieve ca cert: %v", err) } var tests = []struct { name string command string
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed May 01 16:01:49 UTC 2024 - 5.5K bytes - Viewed (0) -
cmd/kubeadm/app/phases/kubeconfig/kubeconfig.go
// NB. this method holds the information about how kubeadm creates kubeconfig files. func getKubeConfigSpecs(cfg *kubeadmapi.InitConfiguration) (map[string]*kubeConfigSpec, error) { caCert, caKey, err := pkiutil.TryLoadCertAndKeyFromDisk(cfg.CertificatesDir, kubeadmconstants.CACertAndKeyBaseName) if os.IsNotExist(errors.Cause(err)) { return nil, errors.Wrap(err, "the CA files do not exist, please run `kubeadm init phase certs ca` to generate it") }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri Jun 07 17:04:18 UTC 2024 - 27K bytes - Viewed (0) -
cmd/kubeadm/app/phases/certs/certs.go
return nil, nil, errors.Errorf("couldn't load %s certificate authority from %s", baseName, pkiDir) } // Try to load certificate authority .crt and .key from the PKI directory caCert, caKey, err := pkiutil.TryLoadCertAndKeyFromDisk(pkiDir, baseName) if err != nil { return nil, nil, errors.Wrapf(err, "failure loading %s certificate authority", baseName) } // Validate period CheckCertificatePeriodValidity(baseName, caCert)
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Dec 05 10:17:14 UTC 2023 - 19.4K bytes - Viewed (0) -
cmd/kubeadm/app/phases/certs/certs_test.go
continue } // asserts expected files are there testutil.AssertFileExists(t, tmpdir, "dummy.key", "dummy.crt") // check created cert resultingCaCert, _, err := pkiutil.TryLoadCertAndKeyFromDisk(tmpdir, "dummy") if err != nil { t.Errorf("failure reading created cert: %v", err) continue } if !resultingCaCert.Equal(test.expectedCa) {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed Jan 31 21:49:21 UTC 2024 - 23.3K bytes - Viewed (0) -
cmd/kubeadm/app/util/pkiutil/pki_helpers.go
_, csrErr := os.Stat(csrPath) _, keyErr := os.Stat(keyPath) return !(os.IsNotExist(csrErr) && os.IsNotExist(keyErr)) } // TryLoadCertAndKeyFromDisk tries to load a cert and a key from the disk and validates that they are valid func TryLoadCertAndKeyFromDisk(pkiPath, name string) (*x509.Certificate, crypto.Signer, error) { cert, err := TryLoadCertFromDisk(pkiPath, name) if err != nil {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed May 01 16:01:49 UTC 2024 - 25.5K bytes - Viewed (0) -
cmd/kubeadm/app/phases/kubeconfig/kubeconfig_test.go
// Adds a pki folder with a ca cert to the temp folder pkidir := testutil.SetupPkiDirWithCertificateAuthority(t, tmpdir) // Retrieves ca cert for assertions caCert, _, err := pkiutil.TryLoadCertAndKeyFromDisk(pkidir, kubeadmconstants.CACertAndKeyBaseName) if err != nil { t.Fatalf("couldn't retrieve ca cert: %v", err) } // Creates an InitConfiguration pointing to the pkidir folder
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri Jun 07 17:04:18 UTC 2024 - 39.5K bytes - Viewed (0)