Skip to content

fix: Do not send patch request if there's no update on FirewallPolicyRule - #4199

Merged
google-oss-prow[bot] merged 3 commits into
GoogleCloudPlatform:masterfrom
gemmahou:fix-firewallpolicyrule-update
Apr 3, 2025
Merged

fix: Do not send patch request if there's no update on FirewallPolicyRule#4199
google-oss-prow[bot] merged 3 commits into
GoogleCloudPlatform:masterfrom
gemmahou:fix-firewallpolicyrule-update

Conversation

@gemmahou

Copy link
Copy Markdown
Collaborator

Change description

Fixes b/406862735

Tests you have done

  • Run make ready-pr to ensure this PR is ready for review.
  • Perform necessary E2E testing for changed resources.

@gemmahou gemmahou changed the title fix: Do not send patch request if there's no update fix: Do not send patch request if there's no update on FirewallPolicyRule Mar 27, 2025
@gemmahou
gemmahou force-pushed the fix-firewallpolicyrule-update branch from 94403d7 to 3a072cb Compare March 28, 2025 00:43

@maqiuyujoyce maqiuyujoyce left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

/lgtm

Just one question about the scenario test.

- "10.100.0.1/32"
priority: 9000
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Have you confirmed that before your change, a PATCH is triggered in this test?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I added this commit to collect log without this change. I added "TOUCH" test flag to trigger a reconcile and confirmed that PATCH is triggered in the log.

@google-oss-prow google-oss-prow Bot added the lgtm label Mar 28, 2025
@google-oss-prow google-oss-prow Bot removed the lgtm label Mar 31, 2025
@gemmahou
gemmahou force-pushed the fix-firewallpolicyrule-update branch from 05cc8e0 to 254b53c Compare March 31, 2025 16:50
@maqiuyujoyce

Copy link
Copy Markdown
Collaborator

/lgtm
/approve

@google-oss-prow google-oss-prow Bot added the lgtm label Apr 3, 2025
@google-oss-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maqiuyujoyce

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow
google-oss-prow Bot merged commit 3de3b4e into GoogleCloudPlatform:master Apr 3, 2025
@gemmahou
gemmahou deleted the fix-firewallpolicyrule-update branch April 3, 2025 22:33
}
if len(paths) == 0 {
log.V(2).Info("no field needs update", "name", a.id.String())
return nil

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should not just return nil here. Instead, we want to call updateOp.UpdateStatus(ctx, status, nil) to make sure the status is updated. This is especially important for first time acquire.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Updated in #4369

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants