Merge pull request #121833 from borg-land/fix-lb-logic

Look for the ingress-uid cm after the Loadbalancer is created
This commit is contained in:
Kubernetes Prow Robot 2023-12-19 00:26:39 +01:00 committed by GitHub
commit 42ab3b7b40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 9 deletions

View File

@ -206,10 +206,6 @@ func VerifyFirewallRule(res, exp *compute.Firewall, network string, portsSubset
if res.Name != exp.Name {
return fmt.Errorf("incorrect name: %v, expected %v", res.Name, exp.Name)
}
// Sample Network value: https://www.googleapis.com/compute/v1/projects/{project-id}/global/networks/e2e
if !strings.HasSuffix(res.Network, "/"+network) {
return fmt.Errorf("incorrect network: %v, expected ends with: %v", res.Network, "/"+network)
}
actualPorts := PackProtocolsPortsFromFirewall(res.Allowed)
expPorts := PackProtocolsPortsFromFirewall(exp.Allowed)

View File

@ -77,11 +77,6 @@ var _ = common.SIGDescribe("Firewall rule", func() {
firewallTestSourceRanges := []string{"0.0.0.0/1", "128.0.0.0/1"}
serviceName := "firewall-test-loadbalancer"
ginkgo.By("Getting cluster ID")
clusterID, err := gce.GetClusterID(ctx, cs)
framework.ExpectNoError(err)
framework.Logf("Got cluster ID: %v", clusterID)
jig := e2eservice.NewTestJig(cs, ns, serviceName)
nodeList, err := e2enode.GetBoundedReadySchedulableNodes(ctx, cs, e2eservice.MaxNodesForEndpointsTests)
framework.ExpectNoError(err)
@ -98,6 +93,13 @@ var _ = common.SIGDescribe("Firewall rule", func() {
svc.Spec.LoadBalancerSourceRanges = firewallTestSourceRanges
})
framework.ExpectNoError(err)
// This configmap is guaranteed to exist after a Loadbalancer type service is created
ginkgo.By("Getting cluster ID")
clusterID, err := gce.GetClusterID(ctx, cs)
framework.ExpectNoError(err)
framework.Logf("Got cluster ID: %v", clusterID)
defer func() {
_, err = jig.UpdateService(ctx, func(svc *v1.Service) {
svc.Spec.Type = v1.ServiceTypeNodePort