Skip to content

Commit 667bc63

Browse files
Merge pull request #1253 from hongkailiu/ClusterStatusConditionType-rm
NO-JIRA: Clean up code to remove ReconciliationIssues
2 parents 52cc813 + e5d297c commit 667bc63

File tree

3 files changed

+0
-69
lines changed

3 files changed

+0
-69
lines changed

pkg/cvo/reconciliation_issues.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ import (
1010
"github.com/openshift/cluster-version-operator/pkg/payload"
1111
)
1212

13-
const (
14-
reconciliationIssuesConditionType configv1.ClusterStatusConditionType = "ReconciliationIssues"
15-
)
16-
1713
// errorWalkCallback processes an error. It returns an error to fail the walk.
1814
type errorWalkCallback func(err error, depth int) error
1915

pkg/cvo/status.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -411,12 +411,6 @@ func updateClusterVersionStatus(cvStatus *configv1.ClusterVersionStatus, status
411411
}
412412
}
413413

414-
// Pre-GA 4.20 TechPreview clusters may have this condition and we need to remove it if it exists when updated to this version
415-
// TODO: Remove this code in 4.21
416-
if oldRiCondition := resourcemerge.FindOperatorStatusCondition(cvStatus.Conditions, reconciliationIssuesConditionType); oldRiCondition != nil {
417-
resourcemerge.RemoveOperatorStatusCondition(&cvStatus.Conditions, reconciliationIssuesConditionType)
418-
}
419-
420414
// default retrieved updates if it is not set
421415
if resourcemerge.FindOperatorStatusCondition(cvStatus.Conditions, configv1.RetrievedUpdates) == nil {
422416
resourcemerge.SetOperatorStatusCondition(&cvStatus.Conditions, configv1.ClusterOperatorStatusCondition{

pkg/cvo/status_test.go

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -217,65 +217,6 @@ func (f fakeRiFlags) CVOConfiguration() bool {
217217
return f.cvoConfiguration
218218
}
219219

220-
// TODO: Can be removed in 4.21
221-
func TestUpdateClusterVersionStatus_AlwaysRemove_ReconciliationIssues(t *testing.T) {
222-
testCases := []struct {
223-
name string
224-
225-
unknownVersion bool
226-
oldCondition *configv1.ClusterOperatorStatusCondition
227-
failure error
228-
}{
229-
{
230-
name: "version known, no failure => condition not present",
231-
unknownVersion: false,
232-
},
233-
{
234-
name: "version known, failure => condition not present",
235-
unknownVersion: false,
236-
failure: fmt.Errorf("something happened"),
237-
},
238-
{
239-
name: "version unknown, failure, existing condition => condition present",
240-
oldCondition: &configv1.ClusterOperatorStatusCondition{
241-
Type: reconciliationIssuesConditionType,
242-
Status: configv1.ConditionFalse,
243-
Reason: "noReconciliationIssuesReason",
244-
Message: "Happy condition is happy",
245-
},
246-
unknownVersion: true,
247-
failure: fmt.Errorf("something happened"),
248-
},
249-
{
250-
name: "version unknown, failure, no existing condition => condition not present",
251-
unknownVersion: true,
252-
failure: fmt.Errorf("something happened"),
253-
},
254-
}
255-
for _, tc := range testCases {
256-
tc := tc
257-
t.Run(tc.name, func(t *testing.T) {
258-
gates := fakeRiFlags{
259-
unknownVersion: tc.unknownVersion,
260-
}
261-
release := configv1.Release{}
262-
getAvailableUpdates := func() *availableUpdates { return nil }
263-
var noErrors field.ErrorList
264-
cvStatus := configv1.ClusterVersionStatus{}
265-
if tc.oldCondition != nil {
266-
cvStatus.Conditions = append(cvStatus.Conditions, *tc.oldCondition)
267-
}
268-
updateClusterVersionStatus(&cvStatus, &SyncWorkerStatus{Failure: tc.failure}, release, getAvailableUpdates, gates, noErrors)
269-
condition := resourcemerge.FindOperatorStatusCondition(cvStatus.Conditions, reconciliationIssuesConditionType)
270-
if condition != nil {
271-
t.Errorf("expected condition %s to not be present, but it was: %v", reconciliationIssuesConditionType, condition)
272-
}
273-
})
274-
275-
}
276-
277-
}
278-
279220
func TestUpdateClusterVersionStatus_FilteringMultipleErrorsForFailingCondition(t *testing.T) {
280221
ignoreLastTransitionTime := cmpopts.IgnoreFields(configv1.ClusterOperatorStatusCondition{}, "LastTransitionTime")
281222
type args struct {

0 commit comments

Comments
 (0)