-
Notifications
You must be signed in to change notification settings - Fork 456
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: sync ovn-ic static route to policy #1670
Conversation
pkg/util/const.go
Outdated
OVNIC_Key = "origin" | ||
OVNIC_Value = "connected" |
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.
OVNIC_Key -> OvnICKey
OVNIC_Value -> OvnICValue
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
pkg/controller/ovn-ic.go
Outdated
klog.V(5).Info(" lr ovn-ic route does not exist") | ||
lrPolicyList, err := c.ovnClient.GetLogicalRouterPoliciesByOptions(util.OVNIC_Key, util.OVNIC_Value) | ||
if err != nil { | ||
klog.Warning("failed to list ovn-ic lr policy ", err) |
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.
klog.Errorf
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
pkg/controller/ovn-ic.go
Outdated
return | ||
} | ||
for _, lrPolicy := range lrPolicyList { | ||
err := c.ovnClient.DeleteRouterPolicy(lr, lrPolicy.UUID) |
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.
if err := xxx; err != 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.
done
pkg/controller/ovn-ic.go
Outdated
for _, lrPolicy := range lrPolicyList { | ||
err := c.ovnClient.DeleteRouterPolicy(lr, lrPolicy.UUID) | ||
if err != nil { | ||
klog.Warningf("deleting router policy failed %v", err) |
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.
klog.Errorf
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
lrPolicy := &ovnnb.LogicalRouterPolicy{ | ||
Action: action, | ||
Match: matchfield, | ||
Options: opts, |
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 set external_ids not options
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.
external_id is listed here for a complete installation. Actually it is not used.
pkg/controller/ovn-ic.go
Outdated
policyMap := map[string]string{} | ||
lrPolicyList, err := c.ovnClient.GetLogicalRouterPoliciesByOptions(util.OVNIC_Key, util.OVNIC_Value) | ||
if err != nil { | ||
klog.Warning("failed to list ovn-ic lr policy ", err) |
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.
all the warning should be replaced with Errorf
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
pkg/controller/ovn-ic.go
Outdated
} | ||
} | ||
for _, uuid := range policyMap { | ||
err := c.ovnClient.DeleteRouterPolicy(lr, uuid) |
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.
if err := xxx; err != 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.
done
10d8b91
to
a9a6b55
Compare
What type of this PR
Examples of user facing changes:
Which issue(s) this PR fixes:
Fixes #1589
interval time of each sync is set to be 5 seconds now. Considering the small number of sync routes, this sync time should not need to be modified.