✨ ROSA: Reconcile ROSAMachinePool fields#4804
✨ ROSA: Reconcile ROSAMachinePool fields#4804k8s-ci-robot merged 5 commits intokubernetes-sigs:mainfrom
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
stevekuznetsov
left a comment
There was a problem hiding this comment.
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.
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"` |
| // +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.
| // 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.
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.
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
|
[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 DetailsNeeds 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
TaintsTuningConfigsWhich 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: