Allow update of onXPN field in fake GCE clients.

This commit is contained in:
Pavithra Ramesh 2020-01-29 12:37:35 -08:00
parent edbd51bc69
commit a2399064a7

View File

@ -35,6 +35,7 @@ type TestClusterValues struct {
SecondaryZoneName string
ClusterID string
ClusterName string
OnXPN bool
}
// DefaultTestClusterValues Creates a reasonable set of default cluster values
@ -74,8 +75,14 @@ func NewFakeGCECloud(vals TestClusterValues) *Cloud {
projectID: vals.ProjectID,
networkProjectID: vals.ProjectID,
ClusterID: fakeClusterID(vals.ClusterID),
onXPN: vals.OnXPN,
}
c := cloud.NewMockGCE(&gceProjectRouter{gce})
gce.c = c
return gce
}
// UpdateFakeGCECloud updates the fake GCE cloud with the specified values. Currently only the onXPN value is updated.
func UpdateFakeGCECloud(g *Cloud, vals TestClusterValues) {
g.onXPN = vals.OnXPN
}