Skip to content

Commit

Permalink
Don't reset last admin update err
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Ontiveros committed Nov 29, 2023
1 parent 4b0e12d commit 5125c2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 0 additions & 4 deletions pkg/frontend/openshiftcluster_putorpatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,6 @@ func adminUpdateProvisioningState(doc *api.OpenShiftClusterDocument) {
case api.MaintenanceTaskPending:
doc.OpenShiftCluster.Properties.MaintenanceState = api.MaintenanceStatePending
case api.MaintenanceTaskNone:
// If customer took action to fix failed maintenance, we can reset the last admin update error
if doc.OpenShiftCluster.Properties.MaintenanceState == api.MaintenanceStateCustomerActionNeeded {
doc.OpenShiftCluster.Properties.LastAdminUpdateError = ""
}
doc.OpenShiftCluster.Properties.MaintenanceState = api.MaintenanceStateNone
case api.MaintenanceTaskCustomerActionNeeded:
doc.OpenShiftCluster.Properties.MaintenanceState = api.MaintenanceStateCustomerActionNeeded
Expand Down
8 changes: 5 additions & 3 deletions pkg/frontend/openshiftcluster_putorpatch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1563,7 +1563,8 @@ func TestPutOrPatchOpenShiftClusterAdminAPI(t *testing.T) {
ClusterProfile: api.ClusterProfile{
FipsValidatedModules: api.FipsValidatedModulesDisabled,
},
MaintenanceTask: "",
LastAdminUpdateError: "error",
MaintenanceTask: "",
NetworkProfile: api.NetworkProfile{
OutboundType: api.OutboundTypeLoadbalancer,
PreconfiguredNSG: api.PreconfiguredNSGDisabled,
Expand Down Expand Up @@ -1605,8 +1606,9 @@ func TestPutOrPatchOpenShiftClusterAdminAPI(t *testing.T) {
MasterProfile: admin.MasterProfile{
EncryptionAtHost: admin.EncryptionAtHostDisabled,
},
OperatorFlags: admin.OperatorFlags{"testFlag": "true"},
MaintenanceState: admin.MaintenanceStateNone,
OperatorFlags: admin.OperatorFlags{"testFlag": "true"},
MaintenanceState: admin.MaintenanceStateNone,
LastAdminUpdateError: "error",
},
},
},
Expand Down

0 comments on commit 5125c2d

Please sign in to comment.