Skip to content

Commit

Permalink
remove ongoing
Browse files Browse the repository at this point in the history
  • Loading branch information
niontive committed Jul 17, 2023
1 parent f1de256 commit d8379b6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions pkg/monitor/cluster/maintenance.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ func (p pucmState) String() string {
}

const (
pucmNone pucmState = "none"
pucmPending pucmState = "pending"
pucmPlannedOngoing pucmState = "planned_ongoing"
pucmUnplannedOngoing pucmState = "unplanned_ongoing"
pucmNone pucmState = "none"
pucmPending pucmState = "pending"
pucmPlanned pucmState = "planned"
pucmUnplanned pucmState = "unplanned"
)

func (mon *Monitor) emitPucmState(ctx context.Context) error {
Expand All @@ -66,9 +66,9 @@ func (mon *Monitor) emitPucmState(ctx context.Context) error {
func getPucmState(clusterProperties api.OpenShiftClusterProperties) pucmState {
if pucmOngoing(clusterProperties) {
if clusterProperties.PucmPending {
return pucmPlannedOngoing
return pucmPlanned
}
return pucmUnplannedOngoing
return pucmUnplanned
} else if clusterProperties.PucmPending {
return pucmPending
}
Expand Down
16 changes: 8 additions & 8 deletions pkg/monitor/cluster/maintenance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,28 @@ func TestEmitPucmState(t *testing.T) {
expectedPucmState: pucmPending,
},
{
name: "state unplanned ongoing - admin updating in flight and no admin update error",
name: "state unplanned - admin updating in flight and no admin update error",
provisioningState: api.ProvisioningStateAdminUpdating,
expectedPucmState: pucmUnplannedOngoing,
expectedPucmState: pucmUnplanned,
},
{
name: "state planned ongoing - admin updating in flight and no admin update error",
name: "state planned - admin updating in flight and no admin update error",
provisioningState: api.ProvisioningStateAdminUpdating,
pucmPending: true,
expectedPucmState: pucmPlannedOngoing,
expectedPucmState: pucmPlanned,
},
{
name: "state unplanned ongoing - not admin updating but admin update error",
name: "state unplanned - not admin updating but admin update error",
provisioningState: api.ProvisioningStateFailed,
adminUpdateErr: "PUCM failed",
expectedPucmState: pucmUnplannedOngoing,
expectedPucmState: pucmUnplanned,
},
{
name: "state planned ongoing - not admin updating but admin update error",
name: "state planned - not admin updating but admin update error",
provisioningState: api.ProvisioningStateFailed,
pucmPending: true,
adminUpdateErr: "PUCM failed",
expectedPucmState: pucmPlannedOngoing,
expectedPucmState: pucmPlanned,
},
} {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit d8379b6

Please sign in to comment.