diff --git a/test/common/trafficmanager/validator/backend.go b/test/common/trafficmanager/validator/backend.go index ae8dda21..a5922de8 100644 --- a/test/common/trafficmanager/validator/backend.go +++ b/test/common/trafficmanager/validator/backend.go @@ -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 }), } ) diff --git a/test/e2e/traffic_manager_test.go b/test/e2e/traffic_manager_test.go index 9b3fe40c..96dc80ad 100644 --- a/test/e2e/traffic_manager_test.go +++ b/test/e2e/traffic_manager_test.go @@ -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) @@ -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)