cluster-api-provider-azure icon indicating copy to clipboard operation
cluster-api-provider-azure copied to clipboard

add more generic validation funcs

Open jackfrancis opened this issue 3 years ago • 4 comments

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

This PR standardizes the way we validate immutable fields via webhook, and refactors existing, one-off validation implementations to re-use the common func.

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:

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

TODOs:

  • [ ] squashed commits
  • [ ] includes documentation
  • [ ] adds unit tests

Release note:

NONE

jackfrancis avatar Oct 10 '22 23:10 jackfrancis

/hold

under active dev

jackfrancis avatar Oct 10 '22 23:10 jackfrancis

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please ask for approval from jackfrancis by writing /assign @jackfrancis in a comment. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Oct 17 '22 21:10 k8s-ci-robot

There are intentional, material changes in this PR to properly handle property immutability for AKS cluster properties that are immutable. The following AzureManagedControlPlane properties are now being checked for strict immutability

We should keep behavior changes separate from refactor changes, especially validation behavior which is considered a breaking change for the user API fields and should have its own release note. Please split those into a separate PR with an explicit release note about which fields are now immutable/required.

CecileRobertMichon avatar Oct 19 '22 21:10 CecileRobertMichon

@jackfrancis: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Oct 20 '22 07:10 k8s-ci-robot

@CecileRobertMichon the part of the work that simply generalizes immutability checks into a common set of convenience funcs is here: https://github.com/kubernetes-sigs/cluster-api-provider-azure/pull/2741

jackfrancis avatar Oct 20 '22 20:10 jackfrancis

/test ls

jackfrancis avatar Oct 24 '22 17:10 jackfrancis

@jackfrancis: The specified target(s) for /test were not found. The following commands are available to trigger required jobs:

  • /test pull-cluster-api-provider-azure-build
  • /test pull-cluster-api-provider-azure-ci-entrypoint
  • /test pull-cluster-api-provider-azure-e2e
  • /test pull-cluster-api-provider-azure-test
  • /test pull-cluster-api-provider-azure-verify

The following commands are available to trigger optional jobs:

  • /test pull-cluster-api-provider-azure-apidiff
  • /test pull-cluster-api-provider-azure-apiversion-upgrade
  • /test pull-cluster-api-provider-azure-capi-e2e
  • /test pull-cluster-api-provider-azure-conformance
  • /test pull-cluster-api-provider-azure-conformance-with-ci-artifacts
  • /test pull-cluster-api-provider-azure-e2e-csi-migration
  • /test pull-cluster-api-provider-azure-e2e-exp
  • /test pull-cluster-api-provider-azure-e2e-optional
  • /test pull-cluster-api-provider-azure-e2e-workload-upgrade
  • /test pull-cluster-api-provider-azure-windows-containerd-upstream-with-ci-artifacts
  • /test pull-cluster-api-provider-azure-windows-containerd-upstream-with-ci-artifacts-serial-slow

Use /test all to run the following jobs that were automatically triggered:

  • pull-cluster-api-provider-azure-apidiff
  • pull-cluster-api-provider-azure-build
  • pull-cluster-api-provider-azure-ci-entrypoint
  • pull-cluster-api-provider-azure-e2e
  • pull-cluster-api-provider-azure-e2e-exp
  • pull-cluster-api-provider-azure-test
  • pull-cluster-api-provider-azure-verify

In response to this:

/test ls

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Oct 24 '22 17:10 k8s-ci-robot

Opened https://github.com/kubernetes-sigs/cluster-api-provider-azure/pull/2795 instead

jackfrancis avatar Nov 09 '22 00:11 jackfrancis