Skip to content

Commit

Permalink
fix: fix the main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiying-lin committed Jan 3, 2025
1 parent 16c7e38 commit c314ce1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion test/common/trafficmanager/validator/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var (
cmpConditionOptions,
cmpopts.IgnoreFields(fleetnetv1alpha1.TrafficManagerEndpointStatus{}, "Name"), // ignore the generated endpoint name
cmpopts.SortSlices(func(s1, s2 fleetnetv1alpha1.TrafficManagerEndpointStatus) bool {
return s1.Cluster.Cluster < s2.Cluster.Cluster
return s1.From.Cluster < s2.From.Cluster
}),
}
)
Expand Down
24 changes: 15 additions & 9 deletions test/e2e/traffic_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,11 @@ 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: memberClusters[0].Name()},
},
},
}
status = validator.ValidateTrafficManagerBackendIfAcceptedAndIgnoringEndpointName(ctx, hubClient, name, false, wantEndpoints)
Expand All @@ -156,14 +158,18 @@ 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: memberClusters[0].Name()},
},
},
{
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: memberClusters[1].Name()},
},
},
}
status = validator.ValidateTrafficManagerBackendIfAcceptedAndIgnoringEndpointName(ctx, hubClient, name, true, wantEndpoints)
Expand Down

0 comments on commit c314ce1

Please sign in to comment.