Skip to content

Commit 177ec55

Browse files
committed
Minor changes
1 parent 5655548 commit 177ec55

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

test/upgrade/after/actuals_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@ import (
1111

1212
placementv1beta1 "go.goms.io/fleet/apis/placement/v1beta1"
1313
"go.goms.io/fleet/pkg/controllers/clusterresourceplacement"
14-
"go.goms.io/fleet/pkg/controllers/work"
1514
scheduler "go.goms.io/fleet/pkg/scheduler/framework"
1615
"go.goms.io/fleet/pkg/utils/condition"
1716
"go.goms.io/fleet/test/e2e/framework"
1817
)
1918

2019
func resourcePlacementRolloutCompletedConditions(generation int64, resourceIsTrackable bool, hasOverride bool) []metav1.Condition {
21-
availableConditionReason := work.WorkNotTrackableReason
20+
availableConditionReason := condition.WorkNotAvailabilityTrackableReason
2221
if resourceIsTrackable {
2322
availableConditionReason = condition.AllWorkAvailableReason
2423
}

test/upgrade/before/actuals_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ import (
1111

1212
placementv1beta1 "go.goms.io/fleet/apis/placement/v1beta1"
1313
"go.goms.io/fleet/pkg/controllers/clusterresourceplacement"
14-
"go.goms.io/fleet/pkg/controllers/work"
1514
"go.goms.io/fleet/pkg/controllers/workapplier"
1615
scheduler "go.goms.io/fleet/pkg/scheduler/framework"
1716
"go.goms.io/fleet/pkg/utils/condition"
1817
"go.goms.io/fleet/test/e2e/framework"
1918
)
2019

2120
func resourcePlacementRolloutCompletedConditions(generation int64, resourceIsTrackable bool, hasOverride bool) []metav1.Condition {
22-
availableConditionReason := work.WorkNotTrackableReason
21+
availableConditionReason := condition.WorkNotAvailabilityTrackableReason
2322
if resourceIsTrackable {
2423
availableConditionReason = condition.AllWorkAvailableReason
2524
}

test/upgrade/before/setup_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ import (
3333
clusterv1beta1 "go.goms.io/fleet/apis/cluster/v1beta1"
3434
placementv1alpha1 "go.goms.io/fleet/apis/placement/v1alpha1"
3535
placementv1beta1 "go.goms.io/fleet/apis/placement/v1beta1"
36+
"go.goms.io/fleet/pkg/controllers/work"
3637
"go.goms.io/fleet/pkg/utils"
38+
"go.goms.io/fleet/pkg/utils/condition"
3739
"go.goms.io/fleet/test/e2e/framework"
3840
)
3941

@@ -113,12 +115,27 @@ var (
113115
ignoreServicePortNodePortProtocolField = cmpopts.IgnoreFields(corev1.ServicePort{}, "NodePort", "Protocol")
114116
ignoreRPSClusterNameField = cmpopts.IgnoreFields(placementv1beta1.ResourcePlacementStatus{}, "ClusterName")
115117

118+
// Since Fleet agents v0.14.0 a minor reason string change was applied on the hub side that
119+
// affects CRP availability status reportings in the resource placement section when untrackable
120+
// resources are involved. This transformer is added to ensure that the compatibility test specs
121+
// can handle this string change smoothly.
122+
//
123+
// Note that the aforementioned change is hub side exclusive and is for informational purposes only.
124+
availableDueToUntrackableResCondAcyclicTransformer = cmpopts.AcyclicTransformer("AvailableDueToUntrackableResCond", func(cond metav1.Condition) metav1.Condition {
125+
transformedCond := cond.DeepCopy()
126+
if cond.Type == string(placementv1beta1.ResourcesAvailableConditionType) && cond.Reason == work.WorkNotTrackableReason {
127+
transformedCond.Reason = condition.WorkNotAvailabilityTrackableReason
128+
}
129+
return *transformedCond
130+
})
131+
116132
crpStatusCmpOptions = cmp.Options{
117133
cmpopts.SortSlices(lessFuncConditionByType),
118134
cmpopts.SortSlices(lessFuncPlacementStatusByClusterName),
119135
cmpopts.SortSlices(utils.LessFuncResourceIdentifier),
120136
cmpopts.SortSlices(utils.LessFuncFailedResourcePlacements),
121137
utils.IgnoreConditionLTTAndMessageFields,
138+
availableDueToUntrackableResCondAcyclicTransformer,
122139
cmpopts.EquateEmpty(),
123140
}
124141
crpWithStuckRolloutStatusCmpOptions = cmp.Options{
@@ -128,6 +145,7 @@ var (
128145
cmpopts.SortSlices(utils.LessFuncFailedResourcePlacements),
129146
utils.IgnoreConditionLTTAndMessageFields,
130147
ignoreRPSClusterNameField,
148+
availableDueToUntrackableResCondAcyclicTransformer,
131149
cmpopts.EquateEmpty(),
132150
}
133151
)

0 commit comments

Comments
 (0)