clean up the tmp Cert data

use function os.Remove to remove file
This commit is contained in:
guangxuli 2016-09-27 22:32:23 +08:00
parent 08dd569424
commit d8331735a2

View File

@ -294,7 +294,7 @@ func TestEmbedNoKeyOrCertDisallowed(t *testing.T) {
func TestEmptyTokenAndCertAllowed(t *testing.T) {
fakeCertFile, _ := ioutil.TempFile("", "cert-file")
defer os.Remove(fakeCertFile.Name())
expectedConfig := newRedFederalCowHammerConfig()
authInfo := clientcmdapi.NewAuthInfo()
authInfo.ClientCertificate = path.Base(fakeCertFile.Name())
@ -507,7 +507,7 @@ func TestUnsetBytes(t *testing.T) {
func TestCAClearsInsecure(t *testing.T) {
fakeCAFile, _ := ioutil.TempFile("", "ca-file")
defer os.Remove(fakeCAFile.Name())
clusterInfoWithInsecure := clientcmdapi.NewCluster()
clusterInfoWithInsecure.InsecureSkipTLSVerify = true