Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-1.6] 🐛 Skip publishing the RemediationRestricted event when there are no unhealthy target #10617

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,15 @@ func (r *Reconciler) reconcile(ctx context.Context, logger logr.Logger, cluster
Message: message,
})

r.recorder.Event(
m,
corev1.EventTypeWarning,
EventRemediationRestricted,
message,
)
// If there are no unhealthy target, skip publishing the `RemediationRestricted` event to avoid misleading.
if len(unhealthy) != 0 {
r.recorder.Event(
m,
corev1.EventTypeWarning,
EventRemediationRestricted,
message,
)
}
errList := []error{}
for _, t := range append(healthy, unhealthy...) {
if err := t.patchHelper.Patch(ctx, t.Machine); err != nil {
Expand Down
Loading