cluster-api-provider-azure
cluster-api-provider-azure copied to clipboard
Add missing test coverage for azuremanagedcontrolplane_webhook.go
/kind cleanup
Describe the solution you'd like****Describe the solution you'd like
Currently, azuremanagedcontrolplane_webhook.go
is missing unit tests in the following areas:
-
validateManagedClusterNetwork() requires a new unit test function:
- Create a fake client like so: https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/main/azure/scope/cluster_test.go#L173
- Test various ownerClusters that are added to the fake client to cover different scenarios in validateManagedClusterNetwork()
-
validateAPIServerAccessProfileUpdate() requires the following test cases to be added to the ValidateUpdate() test:
- old.Spec.APIServerAccessProfile != nil
Environment:
- cluster-api-provider-azure version:
- Kubernetes version: (use
kubectl version
): - OS (e.g. from
/etc/os-release
):