mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
Merge pull request #100201 from aojea/flakekubeadm
kubeadm unit test initalize global variables
This commit is contained in:
commit
854c2cc79f
@ -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