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

[cherry-pick 1.7]: katautils: fix shim v2 fail to work with libnetwork#1795

Merged
egernst merged 1 commit intokata-containers:stable-1.7from
Ace-Tang:stable-1.7-fix-v2
Jun 14, 2019
Merged

[cherry-pick 1.7]: katautils: fix shim v2 fail to work with libnetwork#1795
egernst merged 1 commit intokata-containers:stable-1.7from
Ace-Tang:stable-1.7-fix-v2

Conversation

@Ace-Tang
Copy link
Copy Markdown
Contributor

detail how kata work with libnetwork

  1. kata create a new netns
  2. with EnterNS, kata change netns to the created one.
  3. in pre-start hook, kata will re-exec libnetwork process
    libnetwork-setkey, and send self pid to it. libnetwork use
    /proc/pid/ns/net to find the netns kata use, and set veth into the netns.

v1/v2 shim use the same way to create network, v1 can successful
because EnterNS changed both current thread and main thread's netns.
But use v2 shim, only changed current thread netns, main thread still
use host netns, so it fails. Looks like v1 just lucky to be successful.
In kata, state.Pid should be tid.

Fixes: #1788

Signed-off-by: Ace-Tang aceapril@126.com

detail how kata work with libnetwork
1. kata create a new netns
2. with EnterNS, kata change netns to the created one.
3. in pre-start hook, kata will re-exec libnetwork process
libnetwork-setkey, and send self pid to it. libnetwork use
/proc/pid/ns/net to find the netns kata use, and set veth into the netns.

v1/v2 shim use the same way to create network, v1 can successful
because EnterNS changed both current thread and main thread's netns.
But use v2 shim, only changed current thread netns, main thread still
use host netns, so it fails. Looks like v1 just lucky to be successful.
In kata, `state.Pid` should be tid.

Fixes: #1788

Signed-off-by: Ace-Tang <aceapril@126.com>
@lifupan
Copy link
Copy Markdown
Member

lifupan commented Jun 13, 2019

/test

@Ace-Tang
Copy link
Copy Markdown
Contributor Author

pkg/katatestutils/README.md
README.md
ERROR: Invalid URL 'https://godoc.org/github.com/kata-containers/runtime/pkg/katatestutils' found in the following files:
pkg/katatestutils/README.md
ERROR: Invalid URL 'https://godoc.org/github.com/kata-containers/runtime?status.svg' found in the following files:

Is it caused by network ?

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 13, 2019

Codecov Report

Merging #1795 into stable-1.7 will not change coverage.
The diff coverage is 100%.

@@             Coverage Diff             @@
##           stable-1.7    #1795   +/-   ##
===========================================
  Coverage       53.92%   53.92%           
===========================================
  Files             106      106           
  Lines           13142    13142           
===========================================
  Hits             7087     7087           
  Misses           5206     5206           
  Partials          849      849

@grahamwhaley
Copy link
Copy Markdown
Contributor

@jodh-intel - query on doc url checker and a badge I think?

@jodh-intel
Copy link
Copy Markdown

@Ace-Tang - yes, it's a transitory network issue.

@jodh-intel
Copy link
Copy Markdown

/retest

@egernst egernst added the team/test Need Test Team input label Jun 13, 2019
@egernst egernst merged commit 279496a into kata-containers:stable-1.7 Jun 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

team/test Need Test Team input

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants