From dae335c11500e729c2a88f3204f5bdc0ec70daba Mon Sep 17 00:00:00 2001 From: Pavithra Ramesh Date: Wed, 9 Jun 2021 17:29:57 -0700 Subject: [PATCH] Fix test failure in some envs. --- .../legacy-cloud-providers/gce/gce_loadbalancer_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/staging/src/k8s.io/legacy-cloud-providers/gce/gce_loadbalancer_test.go b/staging/src/k8s.io/legacy-cloud-providers/gce/gce_loadbalancer_test.go index ce7491c6f40..8b0ee001da2 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/gce/gce_loadbalancer_test.go +++ b/staging/src/k8s.io/legacy-cloud-providers/gce/gce_loadbalancer_test.go @@ -185,8 +185,10 @@ func TestBasePath(t *testing.T) { gce, err := fakeGCECloud(vals) // Loadbalancer controller code expects basepath to contain the projects string. expectBasePath := "https://compute.googleapis.com/compute/v1/projects/" + // See https://github.com/kubernetes/kubernetes/issues/102757, the endpoint can have mtls in some cases. + expectMtlsBasePath := "https://compute.mtls.googleapis.com/compute/v1/projects/" require.NoError(t, err) - if gce.service.BasePath != expectBasePath { - t.Errorf("Compute basePath has changed. Got %q, want %q", gce.service.BasePath, expectBasePath) + if gce.service.BasePath != expectBasePath && gce.service.BasePath != expectMtlsBasePath { + t.Errorf("Compute basePath has changed. Got %q, want %q or %q", gce.service.BasePath, expectBasePath, expectMtlsBasePath) } }