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: sync ovn-ic static route to policy #1670

Merged
merged 1 commit into from
Jul 12, 2022
Merged

Conversation

lut777
Copy link
Contributor

@lut777 lut777 commented Jul 7, 2022

What type of this PR

Examples of user facing changes:

  • Bug fixes

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.

@lut777 lut777 added the bug Something isn't working label Jul 7, 2022
Comment on lines 174 to 175
OVNIC_Key = "origin"
OVNIC_Value = "connected"
Copy link
Collaborator

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

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

pkg/controller/ovn-ic.go Outdated Show resolved Hide resolved
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)
Copy link
Collaborator

Choose a reason for hiding this comment

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

klog.Errorf

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

return
}
for _, lrPolicy := range lrPolicyList {
err := c.ovnClient.DeleteRouterPolicy(lr, lrPolicy.UUID)
Copy link
Collaborator

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

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

for _, lrPolicy := range lrPolicyList {
err := c.ovnClient.DeleteRouterPolicy(lr, lrPolicy.UUID)
if err != nil {
klog.Warningf("deleting router policy failed %v", err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

klog.Errorf

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

lrPolicy := &ovnnb.LogicalRouterPolicy{
Action: action,
Match: matchfield,
Options: opts,
Copy link
Collaborator

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

Copy link
Contributor Author

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.

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

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

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

}
}
for _, uuid := range policyMap {
err := c.ovnClient.DeleteRouterPolicy(lr, uuid)
Copy link
Collaborator

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

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

@lut777 lut777 force-pushed the master branch 4 times, most recently from 10d8b91 to a9a6b55 Compare July 11, 2022 08:01
@lut777 lut777 merged commit b3c3221 into kubeovn:master Jul 12, 2022
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
None yet
Development

Successfully merging this pull request may close these issues.

lr-policy breaks ovn-ic interconnection
2 participants