Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Checks provisioning state in Rule resource instead of Group#30

Merged
nacx merged 3 commits intoapache:masterfrom
danielestevez:securityRulesCheck
May 17, 2019
Merged

Checks provisioning state in Rule resource instead of Group#30
nacx merged 3 commits intoapache:masterfrom
danielestevez:securityRulesCheck

Conversation

@danielestevez
Copy link
Member

checkState(
securityGroupAvailable.create(resourceGroupAndName.resourceGroup()).apply(networkSecurityGroup.name()),
"Security group was not updated in the configured timeout");
URI uri = api.getNetworkSecurityRuleApi(resourceGroupAndName.resourceGroup(), networkSecurityGroup.name()).delete(resourceGroupAndName.name());
Copy link
Member

Choose a reason for hiding this comment

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

This looks wrong:

  • The rule is already being deleted in line 297.
  • You are passing the security group name to the delete method, not the rule name.

Remove this line, capture the URL in line 297 and check on that.

"Security group was not updated in the configured timeout");
URI uri = api.getNetworkSecurityRuleApi(resourceGroupAndName.resourceGroup(), networkSecurityGroup.name()).delete(resourceGroupAndName.name());
if (uri != null) {
resourceDeleted.apply(uri);
Copy link
Member

Choose a reason for hiding this comment

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

Let's capture the result and verify with checkState to keep the current behavior and feedback.

@danielestevez
Copy link
Member Author

Thanks @nacx for noticing. Tests however passed but code was clearly wrong

@nacx nacx merged commit e1c6424 into apache:master May 17, 2019
asfgit pushed a commit that referenced this pull request May 17, 2019
* Checks provisioning state in Rule resource instead of Group

* comments by @nacx to proper check and delete rules

* Fixes log message deleting rule
@danielestevez
Copy link
Member Author

danielestevez commented May 17, 2019

Thanks for merging so quickly! I was thinking we could include this one in 2.1.x?
Maybe i should have opened the PR against such branch better

[EDIT] Forget about this, i noticed you already did

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants