Merge pull request #102381 from prameshj/basepathtest

Add a test for verifying compute basepath.
This commit is contained in:
Kubernetes Prow Robot 2021-06-01 16:02:19 -07:00 committed by GitHub
commit 877bd26db0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -178,3 +178,15 @@ func TestEnsureLoadBalancerDeletedDeletesInternalLb(t *testing.T) {
assert.NoError(t, err)
assertInternalLbResourcesDeleted(t, gce, apiService, vals, true)
}
func TestBasePath(t *testing.T) {
t.Parallel()
vals := DefaultTestClusterValues()
gce, err := fakeGCECloud(vals)
// Loadbalancer controller code expects basepath to contain the projects string.
expectBasePath := "https://compute.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)
}
}