-
Notifications
You must be signed in to change notification settings - Fork 316
Safeguard gcpfirewalls cr creation to not return sync errors in Shadow run #2905
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
base: master
Are you sure you want to change the base?
Safeguard gcpfirewalls cr creation to not return sync errors in Shadow run #2905
Conversation
|
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 Once the patch is verified, the new status will be reflected by the 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. |
|
/ok-to-test |
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.
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?
pkg/firewalls/firewalls_l7_cr.go
Outdated
| nodePortRanges []string | ||
| firewallClient firewallclient.Interface | ||
| dryRun bool | ||
| // If firewalls are still reconciled by l7LB. |
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.
nit: this comment isn't clear. Can you expand this?
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.
done
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.
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 |
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.
why do we not want to return this error?
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 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)
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.
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
8bdef7c to
b1a9981
Compare
b1a9981 to
be9d90c
Compare
a6e10a5 to
3d0697f
Compare
3d0697f to
bf975f0
Compare
18193f3 to
0fc7ea4
Compare
|
/retest |
249145b to
2015757
Compare
…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)
02f06c3 to
8727666
Compare
|
/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. |
|
@yswe: changing LGTM is restricted to collaborators In response to this:
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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: maciejriedl, yswe 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 |
|
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. |
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)