test(cli): use t.Cleanup for resetEnv with t.Setenv

Signed-off-by: LarytheLord <llawlietbagsum@gmail.com>
pull/31907/head
LarytheLord 4 months ago
parent 9b30076180
commit 47bde11959

@ -120,7 +120,8 @@ func TestEnvSettings(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
defer resetEnv()()
cleanup := resetEnv()
t.Cleanup(cleanup)
for k, v := range tt.envvars {
t.Setenv(k, v)
@ -219,7 +220,8 @@ func TestEnvOrBool(t *testing.T) {
}
func TestUserAgentHeaderInK8sRESTClientConfig(t *testing.T) {
defer resetEnv()()
cleanup := resetEnv()
t.Cleanup(cleanup)
kubeconfigPath := filepath.Join(t.TempDir(), "config")
kubeconfig := `apiVersion: v1

Loading…
Cancel
Save