Open nojnhuh opened 1 year ago
@nojnhuh: This request has been marked as suitable for new contributors.
Please ensure that the issue body includes answers to the following questions:
For more details on the requirements of such an issue, please see here and ensure that they are met.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue
command.
I'd like to work on this, assigning it to myself.
/assign
@nojnhuh I've submitted a PR the aforementioned cleanup. Kindly review it at your earliest convenience. Thank you!
@SubhasmitaSw Feel free to re-assign yourself to this issue and reopen #4214 if you plan to get back to this.
/unassign @SubhasmitaSw
I would like to go with this issue! If anyone is not working on this issue!
Thank you! /assign @kumarankit999
It doesn't look like there has been any new progress on this issue. I can work on this issue if no one is actively working on it.
Feel free to pick it up @bryan-cox ! /unassign @kumarankit999
/assign
/kind cleanup /good-first-issue /help
What needs cleanup:
There are several places in the defaulting webhooks where CAPZ defaults a static value that could be replaced with the
// +kubebuilder:default
annotation on the API type.e.g. this code defaults a static value https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/e2bd59253c859b151ac6f3222ad6c749e2a1ba75/api/v1beta1/azuremanagedcontrolplane_webhook.go#L75-L78
It should be removed and replaced by the following change to this block: https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/e2bd59253c859b151ac6f3222ad6c749e2a1ba75/api/v1beta1/azuremanagedcontrolplane_types.go#L118-L123
Tests that verify the removed code should also be removed.
After modifying the annotations, run
make generate-manifests
to encode the new defaults in the CRDs.Describe the solution you'd like Walk through the webhooks starting at the following places and replace hand-rolled code to default fields with static fields with the kubebuilder annotation:
https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/e2bd59253c859b151ac6f3222ad6c749e2a1ba75/api/v1beta1/azuremachine_webhook.go#L221 https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/e2bd59253c859b151ac6f3222ad6c749e2a1ba75/api/v1beta1/azuremachinetemplate_webhook.go#L145 https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/e2bd59253c859b151ac6f3222ad6c749e2a1ba75/api/v1beta1/azuremanagedcontrolplane_webhook.go#L70 https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/e2bd59253c859b151ac6f3222ad6c749e2a1ba75/api/v1beta1/azuremanagedmachinepool_webhook.go#L68 https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/e2bd59253c859b151ac6f3222ad6c749e2a1ba75/exp/api/v1beta1/azuremachinepool_webhook.go#L59
Anything else you would like to add: [Miscellaneous information that will assist in solving the issue.]