Skip to content
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

ensure AKS immutable configuration has webhook enforcement #2795

Merged

Conversation

jackfrancis
Copy link
Contributor

@jackfrancis jackfrancis commented Nov 9, 2022

What type of PR is this?

/kind bug
/kind cleanup

What this PR does / why we need it:

This PR replaces a few, one-off validation implementations to re-use common funcs instead.

More importantly, the following AzureManagedControlPlane properties have been fixed for strict immutability as according the requirements of the AKS API for those properties:

  • Spec.SSHPublicKey
  • Spec.DNSServiceIP
  • Spec.NetworkPlugin
  • Spec.NetworkPolicy
  • Spec.LoadBalancerSKU

And the following AzureManagedMachinePool properties as well:

  • Spec.OSDiskSizeGB
  • Spec.MaxPods
  • Spec.OsDiskType

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:

ensure AKS immutable configuration has webhook enforcement

@k8s-ci-robot k8s-ci-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Nov 9, 2022
@k8s-ci-robot
Copy link
Contributor

@jackfrancis: The label(s) kind/fix cannot be applied, because the repository doesn't have them.

In response to this:

What type of PR is this?

/kind fix
/kind cleanup

What this PR does / why we need it:

This PR replaces a few, one-off validation implementations to re-use common funcs instead.

More importantly, the following AzureManagedControlPlane properties have been fixed for strict immutability as according the requirements of the AKS API for those properties:

  • Spec.SSHPublicKey
  • Spec.DNSServiceIP
  • Spec.NetworkPlugin
  • Spec.NetworkPolicy
  • Spec.LoadBalancerSKU

And the following AzureManagedMachinePool properties as well:

  • Spec.OSDiskSizeGB
  • Spec.MaxPods
  • Spec.OsDiskType

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:

ensure AKS immutable configuration has webhook enforcement

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 k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 9, 2022
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 9, 2022

// EnsureStringSlicesAreEquivalent returns if two string slices have equal lengths,
// and that they have the exact same items; it does not enforce strict ordering of items.
func EnsureStringSlicesAreEquivalent(a []string, b []string) bool {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new func is in response to a comment from @nojnhuh here that the existing ensureStringSlicesAreEqual func has a bug (and isn't unit tested).

Copy link
Contributor

@mboersma mboersma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Nice refactoring! This is simpler and more readable by far.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 9, 2022
@jackfrancis jackfrancis added the kind/bug Categorizes issue or PR as related to a bug. label Nov 9, 2022
@jackfrancis
Copy link
Contributor Author

I labeled this kind/bug because strictly speaking the subtle changes to immutability across the described properties reflect a bug in the way we're dealing with the AKS API, but I would advocate we not cherry-pick these changes.

Unless we hear from folks who are running into these edge cases in the wild.

Thoughts @mboersma @CecileRobertMichon @nojnhuh ?

@mboersma
Copy link
Contributor

...I would advocate we not cherry-pick these changes.

Unless we hear from folks who are running into these edge cases in the wild.

Makes sense to me.

@jackfrancis
Copy link
Contributor Author

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jackfrancis

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 14, 2022
@jackfrancis
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit 4985b2a into kubernetes-sigs:main Nov 15, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.6 milestone Nov 15, 2022
@jackfrancis jackfrancis deleted the aks-immutable-properties branch December 9, 2022 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants