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

Remove FieldRequired for EnableVMProtection VNET property #274

Conversation

antoninbas
Copy link
Contributor

Description of your changes

When setting this property to False in the Crossplane VirtualNetwork CR,
the controller finds itself constantly reconciling actual and desired
state. This leads to a lot of instability when trying to create
resources in that VNET, as there is never any convergence.

Adding a few log messages in the provider, I observed that there was
always a mismatch between the EnableVMProtection property for the
desired object (pointer to a boolean value set to false) and the one
for the actual object obtained from the Azure SDK (which is nil).

So it seems that using FieldRequired for EnableVMProtection may not be
accurate, at least not with the version of the SDK currently used by
Crossplane.

Signed-off-by: Antonin Bas abas@vmware.com

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

Created Vnets with EnableVMProtection set to false and looked at reconciliation logs.

When setting this property to False in the Crossplane VirtualNetwork CR,
the controller finds itself constantly reconciling actual and desired
state. This leads to a lot of instability when trying to create
resources in that VNET, as there is never any convergence.

Adding a few log messages in the provider, I observed that there was
always a mismatch between the EnableVMProtection property for the
desired object (pointer to a boolean value set to false) and the one
for the actual object obtained from the Azure SDK (which is nil).

So it seems that using FieldRequired for EnableVMProtection may not be
accurate, at least not with the version of the SDK currently used by
Crossplane.

Signed-off-by: Antonin Bas <abas@vmware.com>
@vaspahomov
Copy link

EnableVMProtection is a legacy flag, that's why now azure sends nil value.
https://stackoverflow.com/questions/67304812/how-do-i-enable-vm-protection-in-my-virtual-network-on-azure-portal/67306089#67306089

@muvaf
Copy link
Member

muvaf commented Jul 26, 2021

@vaspahomov thanks for the explanation! @antoninbas thanks for the change! have you got to test whether this change fixes the problem you're experiencing?

Signed-off-by: Antonin Bas <abas@vmware.com>
@antoninbas
Copy link
Contributor Author

@muvaf yes I can confirm that I have tested the change with my Azure account and that it resolves the issue. With this change VNET reconciliation was successful.

I also pushed a new commit as I forgot to update a unit test originally...

Copy link
Member

@muvaf muvaf left a comment

Choose a reason for hiding this comment

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

Thank you!

@muvaf muvaf merged commit e989ef4 into crossplane-contrib:master Jul 27, 2021
@antoninbas antoninbas deleted the remove-FieldRequired-for-EnableVMProtection-property branch December 14, 2021 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants