Skip to content

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

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

Conversation

gemmahou
Copy link
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
Copy link
Collaborator

@maqiuyujoyce maqiuyujoyce left a comment

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
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
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
Collaborator

/lgtm
/approve

@google-oss-prow google-oss-prow bot added the lgtm label Apr 3, 2025
Copy link
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

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
25 checks passed
@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
Collaborator

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
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