mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
kubeadm unit test initalize global variables
This commit is contained in:
parent
fcee7a0105
commit
dbc6226e7f
@ -41,6 +41,12 @@ func (t *testCertsData) CertificateDir() string { return t.cfg.Certi
|
||||
func (t *testCertsData) CertificateWriteDir() string { return t.cfg.CertificatesDir }
|
||||
|
||||
func TestCertsWithCSRs(t *testing.T) {
|
||||
// restore global variables
|
||||
defer func() {
|
||||
csrOnly = false
|
||||
csrDir = ""
|
||||
}()
|
||||
|
||||
csrDir := testutil.SetupTempDir(t)
|
||||
defer os.RemoveAll(csrDir)
|
||||
certDir := testutil.SetupTempDir(t)
|
||||
@ -52,12 +58,9 @@ func TestCertsWithCSRs(t *testing.T) {
|
||||
}
|
||||
certsData.cfg.CertificatesDir = certDir
|
||||
|
||||
// global vars
|
||||
// set global vars for the test
|
||||
csrOnly = true
|
||||
csrDir = certDir
|
||||
defer func() {
|
||||
csrOnly = false
|
||||
}()
|
||||
|
||||
phase := NewCertsPhase()
|
||||
// find the api cert phase
|
||||
|
Loading…
Reference in New Issue
Block a user