Skip to content

Commit

Permalink
fix member variable issue in traffic manager test
Browse files Browse the repository at this point in the history
  • Loading branch information
jamyct committed Jan 3, 2025
1 parent fc9602c commit 89b646c
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions test/e2e/traffic_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,13 @@ var _ = Describe("Test exporting service via Azure traffic manager", func() {
By("Validating the trafficManagerBackend status")
wantEndpoints := []fleetnetv1alpha1.TrafficManagerEndpointStatus{
{
Weight: ptr.To(int64(100)),
Target: ptr.To(fmt.Sprintf(azureDNSFormat, wm.BuildServiceDNSLabelName(memberClusters[0]), clusterLocation)),
Cluster: &fleetnetv1alpha1.ClusterStatus{Cluster: memberClusters[0].Name()},
Weight: ptr.To(int64(100)),
Target: ptr.To(fmt.Sprintf(azureDNSFormat, wm.BuildServiceDNSLabelName(memberClusters[0]), clusterLocation)),
From: &fleetnetv1alpha1.FromCluster{
ClusterStatus: fleetnetv1alpha1.ClusterStatus{
Cluster: memberClusterNames[0],
},
},
},
}
status = validator.ValidateTrafficManagerBackendIfAcceptedAndIgnoringEndpointName(ctx, hubClient, name, false, wantEndpoints)
Expand All @@ -156,14 +160,22 @@ var _ = Describe("Test exporting service via Azure traffic manager", func() {
By("Validating the trafficManagerBackend status")
wantEndpoints = []fleetnetv1alpha1.TrafficManagerEndpointStatus{
{
Weight: ptr.To(int64(50)),
Target: ptr.To(fmt.Sprintf(azureDNSFormat, wm.BuildServiceDNSLabelName(memberClusters[0]), clusterLocation)),
Cluster: &fleetnetv1alpha1.ClusterStatus{Cluster: memberClusters[0].Name()},
Weight: ptr.To(int64(50)),
Target: ptr.To(fmt.Sprintf(azureDNSFormat, wm.BuildServiceDNSLabelName(memberClusters[0]), clusterLocation)),
From: &fleetnetv1alpha1.FromCluster{
ClusterStatus: fleetnetv1alpha1.ClusterStatus{
Cluster: memberClusterNames[0],
},
},
},
{
Weight: ptr.To(int64(50)),
Target: ptr.To(fmt.Sprintf(azureDNSFormat, wm.BuildServiceDNSLabelName(memberClusters[1]), clusterLocation)),
Cluster: &fleetnetv1alpha1.ClusterStatus{Cluster: memberClusters[1].Name()},
Weight: ptr.To(int64(50)),
Target: ptr.To(fmt.Sprintf(azureDNSFormat, wm.BuildServiceDNSLabelName(memberClusters[1]), clusterLocation)),
From: &fleetnetv1alpha1.FromCluster{
ClusterStatus: fleetnetv1alpha1.ClusterStatus{
Cluster: memberClusterNames[0],
},
},
},
}
status = validator.ValidateTrafficManagerBackendIfAcceptedAndIgnoringEndpointName(ctx, hubClient, name, true, wantEndpoints)
Expand Down

0 comments on commit 89b646c

Please sign in to comment.