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

Add firewall source range DSF #5309

Merged
merged 2 commits into from
Oct 28, 2021

Conversation

slevenick
Copy link
Contributor

Fixes: hashicorp/terraform-provider-google#8076

If this PR is for Terraform, I acknowledge that I have:

  • Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • Ran relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

compute: changed `source_ranges` in `google_compute_firewall_rule` to track changes when it is not set in a config file

@google-cla google-cla bot added the cla: yes label Oct 12, 2021
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 34 insertions(+), 3 deletions(-))
Terraform Beta: Diff ( 2 files changed, 35 insertions(+), 4 deletions(-))
TF Conversion: Diff ( 1 file changed, 31 insertions(+))

@slevenick
Copy link
Contributor Author

/gcbrun

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 34 insertions(+), 3 deletions(-))
Terraform Beta: Diff ( 2 files changed, 35 insertions(+), 5 deletions(-))
TF Conversion: Diff ( 1 file changed, 31 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccServiceNetworkingPeeredDNSDomain_basic|TestAccTags You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=210240

}

// Diff suppress only should suppress removing the default range
if oldInt == 1 && newInt == 1 {
Copy link
Member

Choose a reason for hiding this comment

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

Would newInt be 1 here? I thought it'd be 0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, for reasons I'm not super sure about we end up calling this DSF twice for the normal ["0.0.0.0/0"] -> [] diff when the API returns the default.

Once it is telling us that the length of the set is changing, and the key is "source_ranges.#" and the values are 1 and 0, and once telling us that "0.0.0.0/0" is being removed, but in this case it doesn't really say it is being removed, just that it is being replaced by the empty string. DSFs on sets are mysterious to me

Copy link
Member

Choose a reason for hiding this comment

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

It gets called once on the length, and once on each field I think, so that's expected! Yeah, I don't love DSFs on non primitives

Not sure if that answers the 0/1 question?

Copy link
Member

@rileykarson rileykarson left a comment

Choose a reason for hiding this comment

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

Ah- didn't notice the review request too, just the chat message. LGTM pending an answer to the newInt question.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 37 insertions(+), 3 deletions(-))
Terraform Beta: Diff ( 2 files changed, 39 insertions(+), 4 deletions(-))
TF Conversion: Diff ( 1 file changed, 34 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDatasourceGoogleServiceNetworkingPeeredDnsDomain_basic|TestAccContainerNodePool_withGPU|TestAccSqlUser_postgresIAM|TestAccTags You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=211340

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 37 insertions(+), 3 deletions(-))
Terraform Beta: Diff ( 4 files changed, 39 insertions(+), 5 deletions(-))
TF Conversion: Diff ( 1 file changed, 34 insertions(+))
TF Validator: Diff ( 1 file changed, 34 insertions(+))

@slevenick slevenick merged commit 12be4e0 into GoogleCloudPlatform:master Oct 28, 2021
@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDatasourceGoogleServiceNetworkingPeeredDnsDomain_basic|TestAccCloudbuildWorkerPool_withNetwork|TestAccCloudFunctionsFunction_vpcConnector|TestAccComputeFirewallPolicyRule_update|TestAccComputeForwardingRule_update|TestAccComputeInstanceFromMachineImage_basic|TestAccComputeInstanceFromMachineImage_overrideMetadataDotStartupScript|TestAccComputeInstanceFromMachineImage_diffProject|TestAccComputeOrganizationSecurityPolicyAssociation_organizationSecurityPolicyAssociationBasicExample|TestAccComputeOrganizationSecurityPolicy_organizationSecurityPolicyUpdateExample|TestAccComputeOrganizationSecurityPolicyRule_organizationSecurityPolicyRuleUpdateExample|TestAccComputeRegionNetworkEndpointGroup_regionNetworkEndpointGroupAppengineExample|TestAccContainerAnalysisOccurrence_multipleSignatures|TestAccContainerNodePool_withGPU|TestAccContainerNodePool_ephemeralStorageConfig|TestAccServiceNetworkingPeeredDNSDomain_basic|TestAccSqlUser_postgresIAM You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=213630

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants