-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
network
: fix acc tests failures of versino beta 4
#26678
Conversation
7d8156e
to
083c187
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for fixing these up @wuxu92. I just have one question about why we're changing the setting of a property from true
to false
, otherwise this looks good.
@@ -254,7 +254,7 @@ resource "azurerm_subnet" "test" { | |||
virtual_network_name = azurerm_virtual_network.test.name | |||
address_prefixes = ["10.5.4.0/24"] | |||
|
|||
enforce_private_link_service_network_policies = true | |||
private_link_service_network_policies_enabled = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many of these are getting set to false
when they were true
before, could you explain why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because the original property enforce_private_link_service_network_policies
has unusual expansion logic, which is the opposite of the new property private_link_service_network_policies_enabled
and in version 4.0. The same applies to enforce_private_link_endpoint_network_policies
and private_endpoint_network_policies_enabled
. Therefore, the tool includes special logic to change the value from true
to false
.
terraform-provider-azurerm/internal/services/network/subnet_resource.go
Lines 824 to 834 in f990134
// TODO 4.0: Remove expandEnforceSubnetPrivateLinkNetworkPolicy function | |
func expandEnforceSubnetNetworkPolicy(enabled bool) string { | |
// This is strange logic, but to get the schema to make sense for the end user | |
// I exposed it with the same name that the Azure CLI does to be consistent | |
// between the tool sets, which means true == Disabled. | |
if enabled { | |
return string(subnets.VirtualNetworkPrivateEndpointNetworkPoliciesDisabled) | |
} | |
return string(subnets.VirtualNetworkPrivateEndpointNetworkPoliciesEnabled) | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @wuxu92 LGTM 💯
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Community Note
Description
Testing
Over 260 tests failed when the 4.0 beta flag was enabled in the main branch, compared to only 25-30 failures in 3.0 mode.
there are less than 40 failures in this branch:
66 failures the prev commit:
I fixed some issues and reran part of the 66 failed cases; 27 of them passed. Now, fewer than 40 cases remain unresolved need to be checked manually.
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
This is a (please select all that apply):
Related Issue(s)
Note
If this PR changes meaningfully during the course of review please update the title and description as required.