contiv / netplugin

Container networking for various use cases
Apache License 2.0
514 stars 177 forks source link

k8splugin support manage_network_ns_lifecycle=true from crio #1150

Closed newtonjose closed 6 years ago

newtonjose commented 6 years ago

Description of the changes

Type of fix:

Bug fix

Fixes #

1054 Please describe:

TODO

newtonjose commented 6 years ago

Yes. Is good practice. But the master version of this vendor don't have the function I need. Only https://github.com/containernetworking/plugins/tree/v0.7/pkg/ns https://github.com/containernetworking/plugins/tree/master/pkg/ns.

You now how I get this specific branch with go get?

TIA

On Fri, Aug 17, 2018, 3:47 AM Jackson notifications@github.com wrote:

@liucimin commented on this pull request.

In utils/ns/ns_linux.go https://github.com/contiv/netplugin/pull/1150#discussion_r210818207:

  • }()
  • wg.Wait()
  • return innerError +}
  • +// WithNetNSPath executes the passed closure under the given network +// namespace, restoring the original namespace afterwards. +func WithNetNSPath(nspath string, toRun func(NetNS) error) error {

  • ns, err := GetNS(nspath)
  • if err != nil {
  • return err
  • }
  • defer ns.Close()
  • return ns.Do(toRun) +}

maybe these files can use vendor in the project? https://github.com/containernetworking/plugins/tree/master/pkg/ns

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/contiv/netplugin/pull/1150#pullrequestreview-147113699, or mute the thread https://github.com/notifications/unsubscribe-auth/ARjvR5Q0Xqz1DQZG_o4Lxgo8pIiUH6BAks5uRmcJgaJpZM4V0AUL .