Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for SetupTempDir (0.42 sec)

  1. cmd/kubeadm/app/phases/kubeconfig/kubeconfig_test.go

    	kubeconfigtestutil "k8s.io/kubernetes/cmd/kubeadm/test/kubeconfig"
    )
    
    func TestGetKubeConfigSpecsFailsIfCADoesntExists(t *testing.T) {
    	// Create temp folder for the test case (without a CA)
    	tmpdir := testutil.SetupTempDir(t)
    	defer os.RemoveAll(tmpdir)
    
    	// Creates an InitConfiguration pointing to the pkidir folder
    	cfg := &kubeadmapi.InitConfiguration{
    		ClusterConfiguration: kubeadmapi.ClusterConfiguration{
    			CertificatesDir: tmpdir,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jun 07 17:04:18 UTC 2024
    - 39.5K bytes
    - Viewed (0)
  2. cmd/kubeadm/app/phases/certs/renewal/readwriter_test.go

    		t.Error("read cert does not match with expected new cert")
    	}
    }
    
    func TestKubeconfigReadWriter(t *testing.T) {
    	// creates tmp folders
    	dirKubernetes := testutil.SetupTempDir(t)
    	defer os.RemoveAll(dirKubernetes)
    	dirPKI := testutil.SetupTempDir(t)
    	defer os.RemoveAll(dirPKI)
    
    	// write the CA cert and key to the temporary PKI dir
    	caName := kubeadmconstants.CACertAndKeyBaseName
    	if err := pkiutil.WriteCertAndKey(
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 30 15:17:24 UTC 2024
    - 9.5K bytes
    - Viewed (0)
  3. cmd/kubeadm/app/cmd/kubeconfig_test.go

    	err = os.WriteFile(cfgPath, buf.Bytes(), 0644)
    	return cfgPath, err
    }
    
    func TestKubeConfigSubCommandsThatWritesToOut(t *testing.T) {
    
    	// Temporary folders for the test case
    	tmpdir := testutil.SetupTempDir(t)
    	defer os.RemoveAll(tmpdir)
    
    	// Adds a pki folder with a ca cert to the temp folder
    	pkidir := testutil.SetupPkiDirWithCertificateAuthority(t, tmpdir)
    
    	// Retrieves ca cert for assertions
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 01 16:01:49 UTC 2024
    - 5.5K bytes
    - Viewed (0)
  4. cmd/kubeadm/app/phases/certs/renewal/manager_test.go

    				t.Errorf("Expected %d certificates, saw %d", test.expectedCertificates, len(rm.Certificates()))
    			}
    		})
    	}
    }
    
    func TestRenewUsingLocalCA(t *testing.T) {
    	dir := testutil.SetupTempDir(t)
    	defer os.RemoveAll(dir)
    
    	if err := pkiutil.WriteCertAndKey(dir, "ca", testCACert, testCAKey); err != nil {
    		t.Fatalf("couldn't write out CA certificate to %s", dir)
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 01 16:01:49 UTC 2024
    - 13.9K bytes
    - Viewed (0)
  5. cmd/kubeadm/app/phases/etcd/local_test.go

    		t.Errorf("expected env: %v, got: %v", env, spec.Spec.Containers[0].Env)
    	}
    }
    
    func TestCreateLocalEtcdStaticPodManifestFile(t *testing.T) {
    	// Create temp folder for the test case
    	tmpdir := testutil.SetupTempDir(t)
    	defer os.RemoveAll(tmpdir)
    
    	var tests = []struct {
    		cfg              *kubeadmapi.ClusterConfiguration
    		expectedError    bool
    		expectedManifest string
    	}{
    		{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Apr 23 14:07:27 UTC 2024
    - 15.2K bytes
    - Viewed (0)
  6. cmd/kubeadm/app/phases/upgrade/staticpods_test.go

    		},
    	}
    
    	for i := range tests {
    		test := tests[i]
    		t.Run(test.name, func(t *testing.T) {
    			pkiutiltesting.Reset()
    
    			// Setup up basic requities
    			tmpDir := testutil.SetupTempDir(t)
    			defer os.RemoveAll(tmpDir)
    
    			cfg := testutil.GetDefaultInternalConfig(t)
    			cfg.CertificatesDir = tmpDir
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Jun 01 07:10:31 UTC 2024
    - 32K bytes
    - Viewed (0)
Back to top