-
Notifications
You must be signed in to change notification settings - Fork 578
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
✨ ROSA: Reconcile ROSAMachinePool fields #4804
✨ ROSA: Reconcile ROSAMachinePool fields #4804
Conversation
713e7eb
to
aa768e4
Compare
aa768e4
to
4930814
Compare
da45677
to
ddfd1ce
Compare
- add Taints field - add TuningConfigs field
This is required for when the managment cluster has OwnerReferencesPermissionEnforcement admission controller enabled.
8e9a0b5
to
1d3df4a
Compare
1d3df4a
to
a481de3
Compare
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.
Looks great. Since you've already factored nodePoolBuilder()
and nodePoolToRosaMachinePoolSpec()
really well for unit testing, would you mind adding one for them?
a16b1b1
to
610691b
Compare
@stevekuznetsov added, we can add more test cases later. |
Sounds good, the round-trip unit test is what I had in mind. /lgtm |
// +kubebuilder:validation:Required | ||
// | ||
// The taint key to be applied to a node. | ||
Key string `json:"key"` |
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 usually have the +kubebuilder
tags after the comment, like:
// +kubebuilder:validation:Required | |
// | |
// The taint key to be applied to a node. | |
Key string `json:"key"` | |
// The taint key to be applied to a node. | |
// | |
// +kubebuilder:validation:Required | |
Key string `json:"key"` |
@@ -115,6 +115,7 @@ func (r *ROSAControlPlaneReconciler) SetupWithManager(ctx context.Context, mgr c | |||
// +kubebuilder:rbac:groups=cluster.x-k8s.io,resources=machinepools,verbs=get;list;watch | |||
// +kubebuilder:rbac:groups=controlplane.cluster.x-k8s.io,resources=rosacontrolplanes,verbs=get;list;watch;update;patch;delete | |||
// +kubebuilder:rbac:groups=controlplane.cluster.x-k8s.io,resources=rosacontrolplanes/status,verbs=get;update;patch | |||
// +kubebuilder:rbac:groups=controlplane.cluster.x-k8s.io,resources=rosacontrolplanes/finalizers,verbs=update |
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 this needed?
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.
// TODO: expose in status | ||
rosaScope.Error(err, "rosacontrolplane.spec.network.machineCIDR invalid", networkSpec.MachineCIDR) | ||
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.
Could we move this to a validation webhook, and just return the error here (backoff loop) or set a condition?
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.
Returning an error when the data provided by the user is incorrect would only lead to infinite retry by the controller and not result in a good outcome. It seems universally correct to expose states like this in status so that the user knows that they need to update the object's .spec
and so that the controller does not do extra reconciliation loops that cannot possibly result in a better outcome.
- cleanup *types.go - report erros in conditions
99b3515
to
3defa28
Compare
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.
/approve
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: stevekuznetsov, vincepri 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 |
What type of PR is this?
/kind feature
What this PR does / why we need it:
reconcile changes to the ROSAMachinePool fields
Add 2 new fields
Taints
TuningConfigs
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
Checklist:
Release note: