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

fix: cancel delete staticroute when it's used by NatRule #1733

Merged
merged 1 commit into from
Jul 22, 2022
Merged

fix: cancel delete staticroute when it's used by NatRule #1733

merged 1 commit into from
Jul 22, 2022

Conversation

xujunjie-cover
Copy link
Member

gc will delete staticroute whice used by natrule.

Signed-off-by: xujunjie-cover [email protected]

What type of this PR

Examples of user facing changes:

  • Bug fixes

Which issue(s) this PR fixes:

Fixes #1732

@oilbeater oilbeater added bug Something isn't working need backport labels Jul 22, 2022
@oilbeater oilbeater merged commit f582a11 into kubeovn:master Jul 22, 2022
oilbeater pushed a commit that referenced this pull request Jul 22, 2022
Signed-off-by: xujunjie-cover <[email protected]>
(cherry picked from commit f582a11)
oilbeater pushed a commit that referenced this pull request Jul 22, 2022
Signed-off-by: xujunjie-cover <[email protected]>
(cherry picked from commit f582a11)
oilbeater pushed a commit that referenced this pull request Jul 22, 2022
Signed-off-by: xujunjie-cover <[email protected]>

(cherry picked from commit f582a11)
@@ -647,6 +647,10 @@ func (c *Controller) gcStaticRoute() error {
for _, route := range routes {
if route.CIDR != "0.0.0.0/0" && route.CIDR != "::/0" && c.ipam.ContainAddress(route.CIDR) {
klog.Infof("gc static route %s %s %s", route.Policy, route.CIDR, route.NextHop)
exist, err := c.ovnLegacyClient.NatRuleExists(route.CIDR)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just find some problem after merge. The logical should come before the klog.Infof("gc static route %s %s %s", route.Policy, route.CIDR, route.NextHop) and the err should be logged

Copy link
Member Author

@xujunjie-cover xujunjie-cover Jul 22, 2022

Choose a reason for hiding this comment

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

Sorry, It's my carelessness. I will create a new pr to repair it.
does err need to logged here? it already logged in c.ovnLegacyClient.NatRuleExists.
log twice or only log err here. which is better? @oilbeater

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need backport
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

gc will influence pod use eip or snat.
2 participants