Skip to content

Commit

Permalink
Allow external remediation even if there's no controller owner
Browse files Browse the repository at this point in the history
Signed-off-by: Nir <niry@redhat.com>
  • Loading branch information
n1r1 committed May 4, 2020
1 parent 008d912 commit bb8cab8
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -435,10 +435,6 @@ func (r *ReconcileMachineHealthCheck) mhcRequestsFromMachine(o handler.MapObject

func (t *target) remediate(r *ReconcileMachineHealthCheck) error {
glog.Infof(" %s: start remediation logic", t.string())
if !t.hasControllerOwner() {
glog.Infof("%s: no controller owner, skipping remediation", t.string())
return nil
}

remediationStrategy, ok := t.MHC.Annotations[remediationStrategyAnnotation]
if ok {
Expand All @@ -447,6 +443,11 @@ func (t *target) remediate(r *ReconcileMachineHealthCheck) error {
}
}

if !t.hasControllerOwner() {
glog.Infof("%s: no controller owner, skipping remediation", t.string())
return nil
}

glog.Infof("%s: deleting", t.string())
if err := r.client.Delete(context.TODO(), &t.Machine); err != nil {
r.recorder.Eventf(
Expand Down

0 comments on commit bb8cab8

Please sign in to comment.