-
Notifications
You must be signed in to change notification settings - Fork 289
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
Add CP upgrade reconciler logic #7144
Add CP upgrade reconciler logic #7144
Conversation
Skipping CI for Draft Pull Request. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #7144 +/- ##
==========================================
+ Coverage 71.58% 71.65% +0.06%
==========================================
Files 545 548 +3
Lines 42349 42668 +319
==========================================
+ Hits 30314 30572 +258
- Misses 10343 10397 +54
- Partials 1692 1699 +7 ☔ View full report in Codecov by Sentry. |
if err := r.client.Create(ctx, nodeUpgrade); client.IgnoreAlreadyExists(err) != nil { | ||
return ctrl.Result{}, fmt.Errorf("failed to create node upgrader for machine %s: %v", machineRef.Name, err) | ||
} | ||
for { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have a nested for loop here? I think the way to wait is to create the objects once, and then return the controller, and then have a check above to see if the objects were already created before attempting to create.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need the nested for because we want to create the node upgrade one by one... Although it looks like a nested for it doesn't do anything that actually wait for each of the nodeupgrader object to run through it's lifecycle.
return ctrl.Result{}, nil | ||
} | ||
|
||
func patchControlPlaneUpgrade(ctx context.Context, log logr.Logger, patchHelper *patch.Helper, cpUpgrade anywherev1.ControlPlaneUpgrade, patchOpts ...patch.Option) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is log passed in here? Also, any reason you moved this to it's own function if it only contains one line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, We don't need it here.!
} else { | ||
return ctrl.Result{}, nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} else { | |
return ctrl.Result{}, nil | |
} | |
} | |
return ctrl.Result{}, nil |
f1fa367
to
c4a27cb
Compare
} else { | ||
return ctrl.Result{}, fmt.Errorf("getting node upgrader for machine %s: %v", machineRef.Name, err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} else { | |
return ctrl.Result{}, fmt.Errorf("getting node upgrader for machine %s: %v", machineRef.Name, err) | |
} | |
} | |
return ctrl.Result{}, fmt.Errorf("getting node upgrader for machine %s: %v", machineRef.Name, err) |
Signed-off-by: Rahul Ganesh <[email protected]>
Signed-off-by: Rahul Ganesh <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Add CP uprgader controller logic that is responsible for scheduling node upgrade objects for all control plane nodes. Tested the controller by manually applying the CP upgrade object.
Issue #, if available:
Description of changes:
Testing (if applicable):
Documentation added/planned (if applicable):
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.