Skip to content

Conversation

@maciejriedl
Copy link
Contributor

Make sure that during gcpfirewalls cr creation, sync errors are not returned in Shadow run (when l7LB still reconciles the FWs).

Also fix dryRun flag to properly mean "testing" flow (the logic of the flag usage has not been changed)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 13, 2025
@k8s-ci-robot k8s-ci-robot requested review from aojea and sawsa307 June 13, 2025 12:55
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 13, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @maciejriedl. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 13, 2025
@maciejriedl maciejriedl changed the title Safeguard gcpfirewalls cr creation to not return sync errors in Shadow rub Safeguard gcpfirewalls cr creation to not return sync errors in Shadow run Jun 13, 2025
@TortillaZHawaii
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 27, 2025
Copy link
Member

@swetharepakula swetharepakula left a comment

Choose a reason for hiding this comment

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

The change looks okay to me. However wanted to clarify why we aren't returning an error.

The flag flip should result in a test change. Do we have an unit tests?

nodePortRanges []string
firewallClient firewallclient.Interface
dryRun bool
// If firewalls are still reconciled by l7LB.
Copy link
Member

Choose a reason for hiding this comment

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

nit: this comment isn't clear. Can you expand this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also added a unit test for the changes

logger.V(3).Info("ensureFirewallCR: Could not enforce Firewall CR", "currentFirewallCRName", currentFWCR.Name, "reason", con.Reason)
return fmt.Errorf(con.Reason)
if dryRun {
return nil
Copy link
Member

Choose a reason for hiding this comment

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

why do we not want to return this error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the point of the dryRun - If we are in the "testing" flow, we don't want CRs to eventually cause disruptions to the L7LB (error in PFW could cause L7LB to receive infinte errors)

Copy link
Member

Choose a reason for hiding this comment

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

Should whether we use the error or not happen at the caller instead of here?

Also wondering should we add a metric for the error so we can monitor this. There is the log line, but it will be hard to see that we are doing okay like that

@maciejriedl maciejriedl force-pushed the safeguard-firewall-cr-creation branch from 8bdef7c to b1a9981 Compare July 2, 2025 15:08
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 2, 2025
@maciejriedl maciejriedl force-pushed the safeguard-firewall-cr-creation branch from b1a9981 to be9d90c Compare July 2, 2025 15:10
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 2, 2025
@maciejriedl maciejriedl force-pushed the safeguard-firewall-cr-creation branch 2 times, most recently from a6e10a5 to 3d0697f Compare July 4, 2025 14:16
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 4, 2025
@maciejriedl maciejriedl force-pushed the safeguard-firewall-cr-creation branch from 3d0697f to bf975f0 Compare July 7, 2025 10:04
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 7, 2025
@maciejriedl maciejriedl force-pushed the safeguard-firewall-cr-creation branch from 18193f3 to 0fc7ea4 Compare July 7, 2025 10:14
@maciejriedl
Copy link
Contributor Author

/retest

@maciejriedl maciejriedl force-pushed the safeguard-firewall-cr-creation branch from 249145b to 2015757 Compare July 7, 2025 11:34
…eturned in Shadow run (when l7LB still reconciles the FWs).

Also fix dryRun flag to properly mean "testing" flow (the logic of the flag usage has not been changed)
@maciejriedl maciejriedl force-pushed the safeguard-firewall-cr-creation branch from 02f06c3 to 8727666 Compare July 7, 2025 11:36
@yswe
Copy link
Contributor

yswe commented Jul 7, 2025

/lgtm

Please align with @swetharepakula on the approach of not returning error, in case we're missing something and this error still has to be returned for any reason.

@k8s-ci-robot
Copy link
Contributor

@yswe: changing LGTM is restricted to collaborators

In response to this:

/lgtm

Please align with @swetharepakula on the approach of not returning error, in case we're missing something and this error still has to be returned for any reason.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: maciejriedl, yswe
Once this PR has been reviewed and has the lgtm label, please assign bowei for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 20, 2025
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

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

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants