Skip to content

Commit

Permalink
defer cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dtomcej authored and traefiker committed Jun 19, 2018
1 parent 3f40446 commit 213fb11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions provider/kubernetes/kubernetes_test.go
Expand Up @@ -2227,17 +2227,17 @@ func TestProviderNewK8sInClusterClient(t *testing.T) {
p := Provider{}
os.Setenv("KUBERNETES_SERVICE_HOST", "localhost")
os.Setenv("KUBERNETES_SERVICE_PORT", "443")
defer os.Clearenv()
_, err := p.newK8sClient("")
os.Clearenv()
assert.EqualError(t, err, "failed to create in-cluster configuration: open /var/run/secrets/kubernetes.io/serviceaccount/token: no such file or directory")
}

func TestProviderNewK8sInClusterClientFailLabelSel(t *testing.T) {
p := Provider{}
os.Setenv("KUBERNETES_SERVICE_HOST", "localhost")
os.Setenv("KUBERNETES_SERVICE_PORT", "443")
defer os.Clearenv()
_, err := p.newK8sClient("%")
os.Clearenv()
assert.EqualError(t, err, "invalid ingress label selector: \"%\"")
}

Expand Down

0 comments on commit 213fb11

Please sign in to comment.