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

fix: add logic to skip subnet update under certain conditions #4084

Closed
wants to merge 1 commit into from

Conversation

scottd018
Copy link
Collaborator

Which issue this PR addresses:

Fixes https://issues.redhat.com/browse/ARO-15009

What this PR does / why we need it:

This commit addresses the need for the subnet/write permissions. Currently, in all scenarios, the subnet/write permission is used via the subnet.CreateOrUpdate method. This change adds logic to determine if the values are already set to Disabled and skips running the subnet.CreateOrUpdate method if it is already set appropriately. This will save the need to make an extra API call and also allow users to configure things like Azure policy where subnet/write permissions are not needed.

Test plan for issue:

Currently awaiting access for the Dev ARO-RP shared environment. Once I get access I can run a full E2E test and comment with the results.

Is there any documentation that needs to be updated for this PR?

No documentation needs to be updated, as the end user experience looks identical.

How do you know this will function as expected in production?

No change to the existing logic is introduced. We are only introducing a skip of the API call to create or update a subnet if it does not currently match a desired stated of "Disabled".

This commit addresses the need for the subnet/write permissions.  Currently, in all scenarios, the
subnet/write permission is used via the subnet.CreateOrUpdate method.  This change adds logic to
determine if the values are already set to Disabled and skips running the subnet.CreateOrUpdate
 method if it is already set appropriately.  This will save the need to make an extra API call and
also allow users to configure things like Azure policy where subnet/write permissions are not needed.

Signed-off-by: Dustin Scott <[email protected]>
@hlipsig
Copy link
Contributor

hlipsig commented Feb 5, 2025

I've kicked off CI/e2e. Looking to get a few more reviews and go over this on the weekly review meeting next week, but tentatively LGTM.

@kimorris27
Copy link
Contributor

/azp run ci

Copy link

No pipelines are associated with this pull request.

@kimorris27
Copy link
Contributor

@scottd018 , these changes LGTM, but you'll need to close your current PR and reopen it from a branch off the trunk repo rather than your fork. We can't run our CI Azure pipelines against PRs from forks. If you don't have permission to push a branch to the trunk repo, an ARO team lead should be able to help.

@scottd018
Copy link
Collaborator Author

Closing in favor of #4087 so that CI may properly run

@scottd018 scottd018 closed this Feb 6, 2025
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.

3 participants