Skip to content
This repository was archived by the owner on May 6, 2020. It is now read-only.

network: Update route list according to what's on the system#158

Merged
jcvenegas merged 1 commit into
masterfrom
sboeuf/fix_route_removal
Nov 13, 2017
Merged

network: Update route list according to what's on the system#158
jcvenegas merged 1 commit into
masterfrom
sboeuf/fix_route_removal

Conversation

@sboeuf
Copy link
Copy Markdown

@sboeuf sboeuf commented Nov 10, 2017

When using the destroyPod() function, the removal of the network is
performed but it generates an error. The error says that we cannot
remove the route. This is caused by the fact that we should not try
to remove this route since we have not added it. Indeed, when we do
the network setup, we skip the existing routes.

This patch removes routes already on the system from the route list
held in the pod structure. That way, when destroyPod() is called,
the list does not contain the routes that we have not added.

Fixes #157

@sboeuf sboeuf force-pushed the sboeuf/fix_route_removal branch 3 times, most recently from 7ca813f to 0472856 Compare November 10, 2017 21:01
Comment thread network.go Outdated
// Only save the routes that we are actually adding. Don't add
// skipped routes already existing, otherwise it could cause
// issues when trying to remove them.
finalRouteList = append(finalRouteList, route)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

dumb questions, you are returning finalRouteList only in the case of a successful setup. But later if removeRoutes is called to remove (clean up) the added interfaces. It will try to remove all of them and not only the ones that were added.

So questions:

  1. It is need to return the finalRouteList even on fail ?
  2. In case being need to return finalRouteList or just to have according to the comment (Only save the routes that we are actually adding), can you move finalRouteList = append(finalRouteList, route) after call netHandle.RouteReplace

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good points, I am gonna make some changes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good, thanks !

When using the destroyPod() function, the removal of the network is
performed but it generates an error. The error says that we cannot
remove the route. This is caused by the fact that we should not try
to remove this route since we have not added it. Indeed, when we do
the network setup, we skip the existing routes.

This patch removes routes already on the system from the route list
held in the pod structure. That way, when destroyPod() is called,
the list does not contain the routes that we have not added.

Fixes #157

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
@sboeuf sboeuf force-pushed the sboeuf/fix_route_removal branch from 0472856 to 0214486 Compare November 10, 2017 22:37
@sboeuf
Copy link
Copy Markdown
Author

sboeuf commented Nov 10, 2017

@jcvenegas please take a look, I've addressed your comments !

@jcvenegas
Copy link
Copy Markdown
Contributor

cri-o test failed due to pull timeout , rerunning

00:15:08.093 time="2017-11-10T23:48:27Z" level=error msg="error copying docker://redis:alpine to dir:/home/jenkins/jenkins_slave/workspace/clear-containers-agent-fedora-26-PR/go/src/github.com/kubernetes-incubator/cri-o/.artifacts/redis-image: Error reading blob sha256:b56ae66c29370df48e7377c8f9baa744a3958058a766793f821dadcb144a4647: Get https://dseasb33srnrn.cloudfront.net/registry-v2/docker/registry/v2/blobs/sha256/b5/b56ae66c29370df48e7377c8f9baa744a3958058a766793f821dadcb144a4647/data?Expires=1510358897&Signature=Y~ekRZMp8ua-R1bPnUbgU5iWtFCn3-io~oJmmZZxCN3c0wrhOF3ycPD~murScjGiyfLVG5inKRkhaGQOx38pUkSSPz54qUw8TvzL3nw1haIq6ZAW0nu8BZ4348naG4rS5wqADqZdMdNBASFaDLo0J8wje56CNKk6ZvkBUYteyJI_&Key-Pair-Id=APKAJECH5M7VWIS5YZ6Q: dial tcp: lookup dseasb33srnrn.cloudfront.net on 168.63.129.16:53: read udp 10.0.0.6:42380->168.63.129.16:53: i/o timeout" 

Copy link
Copy Markdown
Contributor

@jcvenegas jcvenegas left a comment

Choose a reason for hiding this comment

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

lgtm

@jcvenegas
Copy link
Copy Markdown
Contributor

@sboeuf looks like goveralls is bit sensitive with the decreased code coverage

@sboeuf
Copy link
Copy Markdown
Author

sboeuf commented Nov 11, 2017

@jcvenegas yeah I guess we have to change this, but that's not a big deal, we can merge it anyway. Just waiting for the CI

@jodh-intel
Copy link
Copy Markdown

jodh-intel commented Nov 13, 2017

lgtm

Approved with PullApprove

@jcvenegas jcvenegas merged commit c91e4ab into master Nov 13, 2017
@sboeuf sboeuf deleted the sboeuf/fix_route_removal branch November 13, 2017 22:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants