mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
Merge pull request #117421 from cbandy/scheduler-testing-setenv
Replace os.Setenv with testing.T.Setenv in tests
This commit is contained in:
commit
763b10f000
@ -343,10 +343,8 @@ profiles:
|
||||
|
||||
// Insulate this test from picking up in-cluster config when run inside a pod
|
||||
// We can't assume we have permissions to write to /var/run/secrets/... from a unit test to mock in-cluster config for testing
|
||||
originalHost := os.Getenv("KUBERNETES_SERVICE_HOST")
|
||||
if len(originalHost) > 0 {
|
||||
os.Setenv("KUBERNETES_SERVICE_HOST", "")
|
||||
defer os.Setenv("KUBERNETES_SERVICE_HOST", originalHost)
|
||||
if len(os.Getenv("KUBERNETES_SERVICE_HOST")) > 0 {
|
||||
t.Setenv("KUBERNETES_SERVICE_HOST", "")
|
||||
}
|
||||
|
||||
defaultPodInitialBackoffSeconds := int64(1)
|
||||
|
Loading…
Reference in New Issue
Block a user