-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 support for regional NEG stripping of maxUtilization based on url #3884
Add support for regional NEG stripping of maxUtilization based on url #3884
Conversation
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 1 file changed, 7 insertions(+), 2 deletions(-)) |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=140707" |
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDataSourceGoogleBigqueryDefaultServiceAccount_basic|TestAccDataSourceDnsManagedZone_basic|TestAccDataSourceDNSKeys_noDnsSec|TestAccDataSourceDNSKeys_basic|TestAccDataSourceComputeNetworkEndpointGroup|TestAccDataSourceGoogleComputeDefaultServiceAccount_basic|TestAccDataSourceComputeImage|TestAccDataSourceGoogleComputeInstanceGroup_basic|TestAccDataSourceGoogleComputeInstanceGroup_fromIGM|TestAccDataSourceGoogleComputeInstanceGroup_withNamedPort|TestAccDataSourceGoogleCloudFunctionsFunction_basic|TestAccDataSourceComputeAddress|TestAccDataSourceComputeBackendBucket_basic|TestAccDataSourceGoogleForwardingRule|TestAccDataSourceComputeBackendService_basic|TestAccDataSourceComputeNodeTypes_basic|TestAccDataSourceComputeGlobalAddress|TestAccComputeRegions_basic|TestAccComputeZones_basic|TestAccDataSourceComputeInstance_basic|TestAccDataSourceGoogleNetwork|TestAccDataSourceComputeResourcePolicy|TestAccDataSourceComputeInstanceSerialPort_basic|TestAccDataSourceComputeRouter|TestAccDataSourceComputeSslCertificate|TestAccDataSourceGoogleSubnetwork|TestAccDataSourceGoogleSslPolicy|TestAccDataSourceGoogleVpnGateway|TestAccContainerClusterDatasource_zonal|TestAccContainerClusterDatasource_regional|TestAccDataSourceGoogleStorageProjectServiceAccount_basic|TestAccBigQueryTableIamBindingGenerated|TestAccBigQueryTableIamMemberGenerated|TestAccBigQueryTableIamPolicyGenerated|TestAccBigQueryTableIamBindingGenerated_withCondition|TestAccBigQueryTableIamMemberGenerated_withCondition|TestAccBigQueryTableIamPolicyGenerated_withCondition|TestAccCloudFunctionsCloudFunctionIamBindingGenerated|TestAccCloudFunctionsCloudFunctionIamMemberGenerated|TestAccCloudFunctionsCloudFunctionIamPolicyGenerated|TestAccComputeInstanceIamBindingGenerated|TestAccComputeInstanceIamMemberGenerated|TestAccComputeInstanceIamBindingGenerated_withCondition|TestAccComputeInstanceIamPolicyGenerated|TestAccComputeInstanceIamMemberGenerated_withCondition|TestAccComputeSubnetworkIamBindingGenerated|TestAccComputeSubnetworkIamMemberGenerated|TestAccComputeSubnetworkIamBindingGenerated_withCondition|TestAccComputeInstanceIamPolicyGenerated_withCondition|TestAccComputeSubnetworkIamMemberGenerated_withCondition|TestAccComputeSubnetworkIamPolicyGenerated|TestAccComputeSubnetworkIamPolicyGenerated_withCondition|TestAccIapAppEngineVersionIamBindingGenerated|TestAccIapAppEngineVersionIamMemberGenerated|TestAccIapAppEngineVersionIamBindingGenerated_withCondition|TestAccIapAppEngineVersionIamPolicyGenerated|TestAccIapAppEngineVersionIamMemberGenerated_withCondition|TestAccIapTunnelInstanceIamBindingGenerated|TestAccIapTunnelInstanceIamMemberGenerated|TestAccIapAppEngineVersionIamPolicyGenerated_withCondition|TestAccIapTunnelInstanceIamBindingGenerated_withCondition|TestAccIapTunnelInstanceIamPolicyGenerated|TestAccIapTunnelInstanceIamMemberGenerated_withCondition|TestAccIapWebBackendServiceIamBindingGenerated|TestAccIapWebBackendServiceIamMemberGenerated|TestAccIapTunnelInstanceIamPolicyGenerated_withCondition|TestAccIapWebBackendServiceIamBindingGenerated_withCondition|TestAccIapWebBackendServiceIamMemberGenerated_withCondition|TestAccIapWebBackendServiceIamPolicyGenerated|TestAccIapWebBackendServiceIamPolicyGenerated_withCondition|TestAccIapAppEngineServiceIamMemberGenerated|TestAccIapAppEngineServiceIamBindingGenerated|TestAccIapAppEngineServiceIamBindingGenerated_withCondition|TestAccIapAppEngineServiceIamPolicyGenerated|TestAccIapAppEngineServiceIamMemberGenerated_withCondition|TestAccIapAppEngineServiceIamPolicyGenerated_withCondition|TestAccStorageBucketIamBindingGenerated|TestAccStorageBucketIamMemberGenerated|TestAccStorageBucketIamBindingGenerated_withCondition|TestAccStorageBucketIamMemberGenerated_withCondition|TestAccActiveDirectoryDomain_activeDirectoryDomainBasicExample|TestAccAppEngineApplicationUrlDispatchRules_appEngineApplicationUrlDispatchRulesBasicExample|TestAccAppEngineServiceSplitTraffic_appEngineServiceSplitTrafficExample|TestAccAppEngineStandardAppVersion_appEngineStandardAppVersionExample|TestAccBigQueryDataset_basic|TestAccBigQueryDataset_bigqueryDatasetBasicExample|TestAccBigQueryDataset_access|TestAccBigQueryDataset_datasetWithContents|TestAccBigQueryDataset_regionalLocation|TestAccBigQueryJob_bigqueryJobQueryExample|TestAccBigQueryJob_bigqueryJobQueryTableReferenceExample|TestAccBigQueryJob_bigqueryJobLoadExample|TestAccBigQueryJob_bigqueryJobLoadTableReferenceExample|TestAccBigQueryJob_bigqueryJobExtractExample|TestAccBigQueryJob_bigqueryJobExtractTableReferenceExample|TestAccBigQueryDatasetAccess_basic|TestAccBigQueryDatasetAccess_iamMember|TestAccBigQueryDatasetAccess_allUsers|TestAccBigQueryDatasetAccess_view|TestAccBigQueryDatasetAccess_allAuthenticatedUsers You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=140708" |
1b3d94b
to
a6f0ce3
Compare
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 1 file changed, 7 insertions(+), 2 deletions(-)) |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=140727" |
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccActiveDirectoryDomain_activeDirectoryDomainBasicExample|TestAccActiveDirectoryDomainTrust_activeDirectoryDomainTrustBasicExample|TestAccComposerEnvironment_basic|TestAccComposerEnvironment_private|TestAccComposerEnvironment_privateWithWebServerControl|TestAccComposerEnvironment_update|TestAccComposerEnvironment_withUpdateOnCreate|TestAccComposerEnvironment_withSoftwareConfig|TestAccComputeAttachedDisk_count|TestAccComposerEnvironment_withNodeConfig|TestAccComputeBackendService_withMaxRatePerEndpoint|TestAccComputeBackendService_withMaxConnectionsPerEndpoint|TestAccComputeBackendService_regionNegBackend|TestAccComputeHealthCheck_healthCheckGrpcExample|TestAccComputeHealthCheck_healthCheckGrpcFullExample|TestAccComputeInstanceFromTemplate_basic|TestAccComputeRegionDisk_deleteDetach|TestAccComputeRegionHealthCheck_regionHealthCheckGrpcExample|TestAccComputeRegionHealthCheck_regionHealthCheckGrpcFullExample|TestAccRegionInstanceGroupManager_basic|TestAccComputeVpnGateway_targetVpnGatewayBasicExample|TestAccComputeVpnTunnel_vpnTunnelBasicExample|TestAccComputeVpnTunnel_vpnTunnelBetaExample|TestAccComputeVpnTunnel_router|TestAccComputeVpnTunnel_defaultTrafficSelectors|TestAccContainerCluster_withNodePoolNodeConfig|TestAccContainerCluster_nodeAutoprovisioning|TestAccContainerNodePool_withWorkloadIdentityConfig|TestAccMemcacheInstance_update|TestAccMemcacheInstance_memcacheInstanceBasicExample|TestAccNetworkManagementConnectivityTest_networkManagementConnectivityTestInstancesExample|TestAccNetworkManagementConnectivityTest_update|TestAccNetworkManagementConnectivityTest_networkManagementConnectivityTestAddressesExample You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=140728" |
if err != nil { | ||
return nil, err | ||
} | ||
if match || strings.Contains(backendGroup.(string), "global/networkEndpointGroups") { |
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.
It feels a bit extra to me to have both regex matching and strings.contains. does it make sense to do just one or the other?
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.
Yeah, string.Contains worked for global NEGs as the key string global/networkEndpointGroups
is contiguous, needed a regex to look for regions/{{region}}/networkEndpointGroups
. I'll make them both use a regex
func testAccComputeBackendService_regionNegBackend(suffix string) string { | ||
return fmt.Sprintf(` | ||
resource "google_compute_backend_service" "backend" { | ||
name = "backend%s" |
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 should be prefixed with tf-test so it gets swept (probably the other resources too)
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 1 file changed, 9 insertions(+), 5 deletions(-)) |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=140958" |
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccActiveDirectoryDomainTrust_activeDirectoryDomainTrustBasicExample|TestAccComposerEnvironment_private|TestAccComposerEnvironment_privateWithWebServerControl|TestAccComputeBackendService_regionNegBackend|TestAccComputeHealthCheck_healthCheckGrpcExample|TestAccComputeHealthCheck_healthCheckGrpcFullExample|TestAccComputeInstanceFromTemplate_basic|TestAccComputeRegionHealthCheck_regionHealthCheckGrpcExample|TestAccComputeRegionHealthCheck_regionHealthCheckGrpcFullExample|TestAccContainerCluster_withNodePoolNodeConfig|TestAccContainerNodePool_withKubeletConfig|TestAccContainerNodePool_withInvalidKubeletCpuManagerPolicy|TestAccContainerNodePool_withLinuxNodeConfig You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=140961" |
// Remove `max_utilization` from any backend that belongs to a global NEG. This field | ||
// has a default value and causes API validation errors | ||
backend["maxUtilization"] = nil | ||
serverlessNegMatchers := [2]*regexp.Regexp{regexp.MustCompile("projects/(?P<project>[^/]+)/regions/(?P<region>[^/]+)/networkEndpointGroups/(?P<name>[^/]+)"), regexp.MustCompile("projects/(?P<project>[^/]+)/global/networkEndpointGroups/(?P<name>[^/]+)")} |
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.
regexes only need to match part of the string, so I think just using (?:global|region/[^/]+)/networkEndpointGroups
as the regex would work too and be a bit less text. any reason to do this way instead?
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 1 file changed, 8 insertions(+), 3 deletions(-)) |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=140962" |
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccActiveDirectoryDomainTrust_activeDirectoryDomainTrustBasicExample|TestAccAppEngineStandardAppVersion_update|TestAccComposerEnvironment_private|TestAccComposerEnvironment_privateWithWebServerControl|TestAccComputeInstanceFromTemplate_basic|TestAccComputeRegionHealthCheck_regionHealthCheckGrpcExample|TestAccComputeRegionHealthCheck_regionHealthCheckGrpcFullExample|TestAccContainerCluster_withNodePoolNodeConfig|TestAccContainerNodePool_withInvalidKubeletCpuManagerPolicy You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=140974" |
Fixes: hashicorp/terraform-provider-google#7051
If this PR is for Terraform, I acknowledge that I have:
make test
andmake lint
to ensure it passes unit and linter tests.Release Note Template for Downstream PRs (will be copied)