"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "staging/src/k8s.io/legacy-cloud-providers/gce/gce_loadbalancer_utils_test.go" between
kubernetes-1.18.14.tar.gz and kubernetes-1.18.15.tar.gz

About: Kubernetes is a platform for automating deployment, scaling, and operations of application containers across clusters of hosts (written in "Go"). 1.18.x series.

gce_loadbalancer_utils_test.go  (kubernetes-1.18.14):gce_loadbalancer_utils_test.go  (kubernetes-1.18.15)
skipping to change at line 250 skipping to change at line 250
) )
// Check that ForwardingRule is created // Check that ForwardingRule is created
fwdRule, err := gce.GetRegionForwardingRule(lbName, gce.region) fwdRule, err := gce.GetRegionForwardingRule(lbName, gce.region)
require.NoError(t, err) require.NoError(t, err)
assert.Equal(t, lbName, fwdRule.Name) assert.Equal(t, lbName, fwdRule.Name)
assert.Equal(t, "TCP", fwdRule.IPProtocol) assert.Equal(t, "TCP", fwdRule.IPProtocol)
assert.Equal(t, backendServiceLink, fwdRule.BackendService) assert.Equal(t, backendServiceLink, fwdRule.BackendService)
// if no Subnetwork specified, defaults to the GCE NetworkURL // if no Subnetwork specified, defaults to the GCE NetworkURL
assert.Equal(t, gce.NetworkURL(), fwdRule.Subnetwork) assert.Equal(t, gce.NetworkURL(), fwdRule.Subnetwork)
// Check that the IP address has been released. IP is only reserved until
ensure function exits.
ip, err := gce.GetRegionAddress(lbName, gce.region)
require.Error(t, err)
assert.Nil(t, ip)
} }
func assertInternalLbResourcesDeleted(t *testing.T, gce *Cloud, apiService *v1.S ervice, vals TestClusterValues, firewallsDeleted bool) { func assertInternalLbResourcesDeleted(t *testing.T, gce *Cloud, apiService *v1.S ervice, vals TestClusterValues, firewallsDeleted bool) {
lbName := gce.GetLoadBalancerName(context.TODO(), "", apiService) lbName := gce.GetLoadBalancerName(context.TODO(), "", apiService)
sharedHealthCheck := !servicehelpers.RequestsOnlyLocalTraffic(apiService) sharedHealthCheck := !servicehelpers.RequestsOnlyLocalTraffic(apiService)
hcName := makeHealthCheckName(lbName, vals.ClusterID, sharedHealthCheck) hcName := makeHealthCheckName(lbName, vals.ClusterID, sharedHealthCheck)
// ensureExternalLoadBalancer and ensureInternalLoadBalancer both create // ensureExternalLoadBalancer and ensureInternalLoadBalancer both create
// Firewalls with the same name. // Firewalls with the same name.
if firewallsDeleted { if firewallsDeleted {
skipping to change at line 288 skipping to change at line 293
// Check that Instance Group is deleted // Check that Instance Group is deleted
igName := makeInstanceGroupName(vals.ClusterID) igName := makeInstanceGroupName(vals.ClusterID)
ig, err := gce.GetInstanceGroup(igName, vals.ZoneName) ig, err := gce.GetInstanceGroup(igName, vals.ZoneName)
assert.Error(t, err) assert.Error(t, err)
assert.Nil(t, ig) assert.Nil(t, ig)
// Check that HealthCheck is deleted // Check that HealthCheck is deleted
healthcheck, err := gce.GetHealthCheck(hcName) healthcheck, err := gce.GetHealthCheck(hcName)
require.Error(t, err) require.Error(t, err)
assert.Nil(t, healthcheck) assert.Nil(t, healthcheck)
// Check that the IP address has been released
ip, err := gce.GetRegionAddress(lbName, gce.region)
require.Error(t, err)
assert.Nil(t, ip)
} }
func checkEvent(t *testing.T, recorder *record.FakeRecorder, expected string, sh ouldMatch bool) bool { func checkEvent(t *testing.T, recorder *record.FakeRecorder, expected string, sh ouldMatch bool) bool {
select { select {
case received := <-recorder.Events: case received := <-recorder.Events:
if strings.HasPrefix(received, expected) != shouldMatch { if strings.HasPrefix(received, expected) != shouldMatch {
t.Errorf(received) t.Errorf(received)
if shouldMatch { if shouldMatch {
t.Errorf("Should receive message \"%v\" but got \ "%v\".", expected, received) t.Errorf("Should receive message \"%v\" but got \ "%v\".", expected, received)
} else { } else {
 End of changes. 2 change blocks. 
0 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)