Skip to content

Commit f0b2bc2

Browse files
Merge pull request openshift#350 from ingvagabund/run-correct-deep-equal
Use semantic DeepEqual for map of disrupted machines comparison
2 parents 8b8563a + b2bca4e commit f0b2bc2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/controller/disruption/disruption.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ package disruption
33
import (
44
"context"
55
"fmt"
6-
"reflect"
76
"time"
87

98
"github.com/golang/glog"
109
mapiv1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1"
1110
healthcheckingv1alpha1 "github.com/openshift/machine-api-operator/pkg/apis/healthchecking/v1alpha1"
1211
"github.com/openshift/machine-api-operator/pkg/util"
1312
machineutil "github.com/openshift/machine-api-operator/pkg/util/machines"
13+
apiequality "k8s.io/apimachinery/pkg/api/equality"
1414

1515
"k8s.io/api/core/v1"
1616
"k8s.io/apimachinery/pkg/api/errors"
@@ -324,7 +324,7 @@ func (r *ReconcileMachineDisruption) updateMachineDisruptionBudgetStatus(
324324
mdb.Status.DesiredHealthy == desiredHealthy &&
325325
mdb.Status.ExpectedMachines == expectedCount &&
326326
mdb.Status.MachineDisruptionsAllowed == disruptionsAllowed &&
327-
reflect.DeepEqual(mdb.Status.DisruptedMachines, disruptedMachines) &&
327+
apiequality.Semantic.DeepEqual(mdb.Status.DisruptedMachines, disruptedMachines) &&
328328
mdb.Status.ObservedGeneration == mdb.Generation {
329329
return nil
330330
}

0 commit comments

Comments
 (0)