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

Propagate errors of ARO MachineHealthCheckController to ARO Operator #3177

Merged
merged 7 commits into from
Oct 17, 2023

Conversation

safwank97
Copy link
Contributor

Which issue this PR addresses:

Fixes - https://issues.redhat.com/browse/ARO-3256

What this PR does / why we need it:

Aggregates errors from the MachineHealthCheck controller and propagates to the ARO Operator.

Test plan for issue:

As of now I think it must pass the local test cases after spinning up a test cluster and if case scenarios falls under the test conditions defined in code then error propagation will happen.

Is there any documentation that needs to be updated for this PR?

None that I'm aware of.

Copy link
Collaborator

@SudoBrendan SudoBrendan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far, thanks for your work on this. One bug to fix. The last thing I think is to add some E2E tests for validating the conditions of the operator during each test execution.

As a final super-nit, there are quite a few newlines added that I don't think add value (at least 6). It's likely best to delete those to reduce the diff.

err := r.client.Get(ctx, types.NamespacedName{Name: arov1alpha1.SingletonClusterName}, instance)
// Reconcile watches MachineHealthCheck objects, and if any changes,
// reconciles the associated ARO MachineHealthCheck object

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% sure, but I think this extra newline might mess up godoc on this function.

Copy link
Contributor Author

@safwank97 safwank97 Sep 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So should I just remove the blank lines or the comment also? Because other ones are just comments on it for code readability. I can remove them anyways we have a proper doc on those available under readme.md.

@safwank97 safwank97 dismissed SudoBrendan’s stale review September 20, 2023 19:08

Addressed all coments just left with E2E

Copy link
Collaborator

@SudoBrendan SudoBrendan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, LGTM. I think removing the MHC prefix changes would reduce the diff and keep this controller in-line with other controller standard patterns. Nice work!

@safwank97
Copy link
Contributor Author

Removed the MHC Prefix.

@safwank97
Copy link
Contributor Author

Done.

Copy link
Collaborator

@SudoBrendan SudoBrendan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic and tests are looking great! I found a few more breaks from convention with a few struct/function names. Keeping our controllers and properties named consistently makes it easier to work on each of them. Excellent work, thanks Mohammed!

cmd/aro/operator.go Outdated Show resolved Hide resolved
@safwank97
Copy link
Contributor Author

I'll take care of that part you mentioned. Thank you very much.

Copy link
Collaborator

@tsatam tsatam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, there are just some minor fixups to make, awesome work!

@safwank97 safwank97 force-pushed the propogate-errors-mhc-controller branch from df83a40 to bf8b8d9 Compare October 13, 2023 03:14
@safwank97
Copy link
Contributor Author

Done.

Copy link
Collaborator

@SudoBrendan SudoBrendan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking really clean! Only one comment based on our discussion. Thanks for your hard work on this!

if !instance.Spec.OperatorFlags.GetSimpleBoolean(managed) {
r.SetProgressing(ctx, "Not MHC Managed for cluster maintenance purpose.")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving a comment here based on our discussion yesterday, it seems like Progressing isn't necessary here. We should remove the SetProgresing and ClearProgressing calls.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree here. Progressing is not required and will solve a few of the other requested changes on this PR by removing it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed those calls.

Copy link
Collaborator

@SudoBrendan SudoBrendan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just need all CI/E2E green :)

Copy link
Collaborator

@cadenmarchese cadenmarchese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

Copy link
Contributor

@jhoreman jhoreman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks for this!

@SudoBrendan SudoBrendan merged commit 66c113a into Azure:master Oct 17, 2023
18 checks passed
ventifus pushed a commit to ventifus/ARO-RP that referenced this pull request Feb 7, 2024
…zure#3177)

* Propagate errors of ARO MachineHealthCheckController to ARO Operator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants