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

Add validations for AzureMachine Updates #558

Closed
CecileRobertMichon opened this issue Apr 20, 2020 · 18 comments · Fixed by #1409
Closed

Add validations for AzureMachine Updates #558

CecileRobertMichon opened this issue Apr 20, 2020 · 18 comments · Fixed by #1409
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.

Comments

@CecileRobertMichon
Copy link
Contributor

/kind feature

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

Some fields are immutable and we should fail when they are updated.

We should add to the already implemented validation for AzureMachines here:

https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/master/api/v1alpha3/azuremachine_webhook.go#L56

You can also look how CAPA achieves this here https://github.com/kubernetes-sigs/cluster-api-provider-aws/blob/master/api/v1alpha3/awsmachine_webhook.go#L55.

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • cluster-api-provider-azure version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):
@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 20, 2020
@CecileRobertMichon
Copy link
Contributor Author

/help
/good-first-issue

@k8s-ci-robot k8s-ci-robot added good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Apr 20, 2020
@CecileRobertMichon CecileRobertMichon added this to Backlog in Cluster API Azure via automation Apr 20, 2020
@srm09
Copy link
Contributor

srm09 commented May 23, 2020

@CecileRobertMichon Where can I find docs listing the immutable fields?

@CecileRobertMichon
Copy link
Contributor Author

@srm09 this hasn't been documented yet, one the CAPZ maintainers needs to do a bit of work to list those in this issue before it can really be picked up by a newcomer, going to remove the good first issue label for now.

/remove good-first-issue

@CecileRobertMichon
Copy link
Contributor Author

/remove-good-first-issue

@k8s-ci-robot k8s-ci-robot removed the good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. label May 26, 2020
@CecileRobertMichon CecileRobertMichon added this to the next milestone Jun 4, 2020
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 2, 2020
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 2, 2020
@CecileRobertMichon
Copy link
Contributor Author

/remove-lifecycle stale

@alexeldeib
Copy link
Contributor

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Oct 29, 2020
@CecileRobertMichon
Copy link
Contributor Author

Let's allow updates for:

  • AdditionalTags
  • ProviderID

And disallow updates for everything else in AzureMachine spec for now. Did an audit of spec and these are the only two I could see as being updatable. Tags get reconciled separately by the tags service. Everything else that is a VM property won't be updated after create since we don't update existing VMs. Users should update the AzureMachineTemplate instead to create new machines that have the desired properties.

ProviderID should technically not change but since right now the provider sets it on every iteration I think it's okay to leave it as updatable.

@devigned wdyt?

/good-first-issue

@k8s-ci-robot
Copy link
Contributor

@CecileRobertMichon:
This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

Let's allow updates for:

  • AdditionalTags
  • ProviderID

And disallow updates for everything else in AzureMachine spec for now. Did an audit of spec and these are the only two I could see as being updatable. Tags get reconciled separately by the tags service. Everything else that is a VM property won't be updated after create since we don't update existing VMs. Users should update the AzureMachineTemplate instead to create new machines that have the desired properties.

ProviderID should technically not change but since right now the provider sets it on every iteration I think it's okay to leave it as updatable.

@devigned wdyt?

/good-first-issue

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 the good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. label Dec 16, 2020
@srm09
Copy link
Contributor

srm09 commented Dec 16, 2020

/assign

@CecileRobertMichon
Copy link
Contributor Author

@srm09 are you still interested in working on this one?

@srm09
Copy link
Contributor

srm09 commented Feb 19, 2021

Whoops, @CecileRobertMichon I totally forgot about this one. Gimme a day or two, otherwise I will unassign myself.

@srm09
Copy link
Contributor

srm09 commented Feb 24, 2021

@CecileRobertMichon The current implementation allows for updates of a bunch of other values:

  • OSDisk
  • SSHPublicKey
  • Identity ...
    Do we wanna keep those or is the plan to disallow these and just allow AdditionalTags and ProviderID ?

@CecileRobertMichon
Copy link
Contributor Author

@srm09 see my comment above. Only AdditionalTags and ProviderID should be mutable as VMs are immutable and any other spec that is updated won't actually result in the VM being updated.

@shivi28
Copy link
Contributor

shivi28 commented May 24, 2021

Hello @CecileRobertMichon, Is this issue still required?
@srm09 Are you planning to work on this? If not, then please let me know as I would like to pick this up. :)

@CecileRobertMichon
Copy link
Contributor Author

@shivi28 please go for it, I don't think there is an active PR. Please comment /assign below if you do decide to work on it.

/unassign @srm09

@shysank
Copy link
Contributor

shysank commented May 25, 2021

/assign @shivi28

Cluster API Azure automation moved this from Backlog to Done (2020 - Q2) Jun 3, 2021
@CecileRobertMichon CecileRobertMichon removed this from the next milestone May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.
Projects
No open projects
Cluster API Azure
  
Done (2020 - Q2)
7 participants