Skip to content

Commit

Permalink
Revise the updateOperator Task
Browse files Browse the repository at this point in the history
  • Loading branch information
mociarain committed Feb 7, 2024
1 parent 1872e81 commit d595c41
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pkg/cluster/adminupdate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func TestAdminUpdateSteps(t *testing.T) {
doc.OpenShiftCluster.Properties.MaintenanceTask = api.MaintenanceTaskOperator
return doc, true
},
shouldRunSteps: concatMultipleSlices(zerothSteps, operatorUpdateSteps),
shouldRunSteps: concatMultipleSlices(zerothSteps, certificateRenewalSteps, operatorUpdateSteps),
},
{
name: "ARO Operator Update on <= 4.6 cluster does not update operator",
Expand All @@ -107,7 +107,7 @@ func TestAdminUpdateSteps(t *testing.T) {
doc.OpenShiftCluster.Properties.ClusterProfile.Version = "4.6.62"
return doc, true
},
shouldRunSteps: zerothSteps,
shouldRunSteps: concatMultipleSlices(zerothSteps, certificateRenewalSteps),
},
{
name: "ARO Operator Update on 4.7.0 cluster does update operator",
Expand All @@ -118,7 +118,7 @@ func TestAdminUpdateSteps(t *testing.T) {
doc.OpenShiftCluster.Properties.ClusterProfile.Version = "4.7.0"
return doc, true
},
shouldRunSteps: concatMultipleSlices(zerothSteps, operatorUpdateSteps),
shouldRunSteps: concatMultipleSlices(zerothSteps, certificateRenewalSteps, operatorUpdateSteps),
},
{
name: "Everything update and adopt Hive.",
Expand Down
7 changes: 5 additions & 2 deletions pkg/cluster/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,13 @@ func (m *manager) adminUpdate() []steps.Step {
if m.adoptViaHive && !m.clusterWasCreatedByHive() {
stepsToRun = append(stepsToRun, m.getHiveAdoptionAndReconciliationSteps()...)
}
} else if isOperator {
stepsToRun = append(stepsToRun, m.getCertificateRenewalSteps()...)
if m.shouldUpdateOperator() {
stepsToRun = append(stepsToRun, m.getOperatorUpdateSteps()...)
}
} else if isRenewCerts {
stepsToRun = append(stepsToRun, m.getCertificateRenewalSteps()...)
} else if isOperator && m.shouldUpdateOperator() {
stepsToRun = append(stepsToRun, m.getOperatorUpdateSteps()...)
}

// We don't run this on an operator-only deploy as PUCM scripts then cannot
Expand Down

0 comments on commit d595c41

Please sign in to comment.