Skip to content

Commit

Permalink
Merge pull request #2737 from k8s-infra-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…2735-to-release-1.24

[release-1.24] [e2e] Skip azure-load-balancer-resource-group test for testgrid
  • Loading branch information
k8s-ci-robot committed Nov 11, 2022
2 parents 3fb9fe6 + cec513e commit 5727393
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/e2e/network/ensureloadbalancer.go
Expand Up @@ -979,7 +979,7 @@ func waitForNodesInLBBackendPool(tc *utils.AzureTestClient, ip string, expectedN
}

func judgeInternal(service v1.Service) bool {
return service.Annotations[consts.ServiceAnnotationLoadBalancerInternal] == "true"
return service.Annotations[consts.ServiceAnnotationLoadBalancerInternal] == utils.TrueValue
}

func getLBBackendPoolIndex(lb *aznetwork.LoadBalancer) int {
Expand Down Expand Up @@ -1011,7 +1011,7 @@ func updateServiceLBIP(service *v1.Service, isInternal bool, ip string) (result
return
}
if isInternal {
result.Annotations[consts.ServiceAnnotationLoadBalancerInternal] = "true"
result.Annotations[consts.ServiceAnnotationLoadBalancerInternal] = utils.TrueValue
} else {
delete(result.Annotations, consts.ServiceAnnotationLoadBalancerInternal)
}
Expand Down
3 changes: 3 additions & 0 deletions tests/e2e/network/service_annotations.go
Expand Up @@ -276,6 +276,9 @@ var _ = Describe("Service with annotation", Label(utils.TestSuiteLabelServiceAnn
})

It("should support service annotation 'service.beta.kubernetes.io/azure-load-balancer-resource-group'", func() {
if os.Getenv(utils.AKSTestCCM) != utils.TrueValue {
Skip("Skip this test because ARM is not working properly on testgrid testbeds")
}
By("creating a test resource group")
rg, cleanup := utils.CreateTestResourceGroup(tc)
defer cleanup(to.String(rg.Name))
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/utils/azure_auth.go
Expand Up @@ -44,6 +44,8 @@ const (
// If "E2E_ON_AKS_CLUSTER" is true, the test is running on a AKS cluster.
AKSTestCCM = "E2E_ON_AKS_CLUSTER"
AKSClusterType = "CLUSTER_TYPE"

TrueValue = "true"
)

// AzureAuthConfig holds auth related part of cloud config
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/utils/node_utils.go
Expand Up @@ -271,7 +271,7 @@ func LabelNode(cs clientset.Interface, node *v1.Node, label string, isDelete boo
Logf("Found label %s on node %s, do nothing", label, node.Name)
return node, nil
}
node.Labels[label] = "true"
node.Labels[label] = TrueValue
node, err := cs.CoreV1().Nodes().Update(context.Background(), node, metav1.UpdateOptions{})
return node, err
}
Expand Down

0 comments on commit 5727393

Please sign in to comment.