diff --git a/cluster-autoscaler/simulator/clustersnapshot/predicate/predicate_snapshot_test.go b/cluster-autoscaler/simulator/clustersnapshot/predicate/predicate_snapshot_test.go index b56a67e9e729..ad9b78638788 100644 --- a/cluster-autoscaler/simulator/clustersnapshot/predicate/predicate_snapshot_test.go +++ b/cluster-autoscaler/simulator/clustersnapshot/predicate/predicate_snapshot_test.go @@ -1119,6 +1119,7 @@ func validTestCases(t *testing.T, snapshotName string) []modificationTestCase { // We don't care about this field staying the same, and it differs because it's a global counter bumped on every AddPod. cmpopts.IgnoreFields(schedulerframework.NodeInfo{}, "Generation"), cmp.AllowUnexported(framework.NodeInfo{}, schedulerframework.NodeInfo{}), + cmpopts.IgnoreUnexported(schedulerframework.PodInfo{}), cmpopts.SortSlices(func(i1, i2 *framework.NodeInfo) bool { return i1.Node().Name < i2.Node().Name }), IgnoreObjectOrder[*resourceapi.ResourceClaim](), IgnoreObjectOrder[*resourceapi.ResourceSlice](), diff --git a/cluster-autoscaler/simulator/dynamicresources/snapshot/snapshot_test.go b/cluster-autoscaler/simulator/dynamicresources/snapshot/snapshot_test.go index 2edeef7fc837..386765313f7a 100644 --- a/cluster-autoscaler/simulator/dynamicresources/snapshot/snapshot_test.go +++ b/cluster-autoscaler/simulator/dynamicresources/snapshot/snapshot_test.go @@ -572,6 +572,7 @@ func TestSnapshotWrapSchedulerNodeInfo(t *testing.T) { t.Fatalf("Snapshot.WrapSchedulerNodeInfo(): unexpected error (-want +got): %s", diff) } cmpOpts := []cmp.Option{cmpopts.EquateEmpty(), cmp.AllowUnexported(framework.NodeInfo{}, schedulerframework.NodeInfo{}), + cmpopts.IgnoreUnexported(schedulerframework.PodInfo{}), test.IgnoreObjectOrder[*resourceapi.ResourceClaim](), test.IgnoreObjectOrder[*resourceapi.ResourceSlice]()} if diff := cmp.Diff(tc.wantNodeInfo, nodeInfo, cmpOpts...); diff != "" { t.Errorf("Snapshot.WrapSchedulerNodeInfo(): unexpected output (-want +got): %s", diff) diff --git a/cluster-autoscaler/simulator/framework/infos_test.go b/cluster-autoscaler/simulator/framework/infos_test.go index b50c9cca4c0a..b2a102032286 100644 --- a/cluster-autoscaler/simulator/framework/infos_test.go +++ b/cluster-autoscaler/simulator/framework/infos_test.go @@ -205,6 +205,7 @@ func TestNodeInfo(t *testing.T) { cmpopts.SortSlices(func(p1, p2 *schedulerframework.PodInfo) bool { return p1.Pod.Name < p2.Pod.Name }), + cmpopts.IgnoreUnexported(schedulerframework.PodInfo{}), } if diff := cmp.Diff(tc.wantSchedNodeInfo, wrappedNodeInfo.ToScheduler(), nodeInfoCmpOpts...); diff != "" { t.Errorf("ToScheduler() output differs from expected, diff (-want +got): %s", diff) @@ -297,6 +298,7 @@ func TestDeepCopyNodeInfo(t *testing.T) { // We don't care about this field staying the same, and it differs because it's a global counter bumped // on every AddPod. cmpopts.IgnoreFields(schedulerframework.NodeInfo{}, "Generation"), + cmpopts.IgnoreUnexported(schedulerframework.PodInfo{}), ); diff != "" { t.Errorf("nodeInfo differs after DeepCopyNodeInfo, diff (-want +got): %s", diff) }