Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dcbw
Copy link
Collaborator

@dcbw dcbw commented Jan 11, 2018

PodNetwork has a new member "Networks" which takes an array of
strings. These map to CNI configuration network names (the "name"
field of CNI config JSON).

If Networks is left empty, then the previous behavior of using
the first found config in /etc/cni/net.d still happens.

Signed-off-by: Dan Williams [email protected]

@mrunalp @rajatchopra what do you guys think?

Copy link
Collaborator

@rajatchopra rajatchopra left a comment

Choose a reason for hiding this comment

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

Looks fine to me, except one comment above. I will give it another pass tomorrow.

Did we want to expose any other functions meanwhile? Like GetNetwork? so that the library can be used for other purposes?


// Search for vendor-specific plugins as well as default plugins in the CNI codebase.
vendorDir := vendorCNIDir(vendorCNIDirPrefix, confList.Plugins[0].Network.Type)
vendorDir := vendorCNIDir(plugin.vendorCNIDirPrefix, confList.Plugins[0].Network.Type)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we flatten Plugins and all the Plugin.Network.Type in the Path? Plugins[0] will still leave it selective.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Could we flatten Plugins and all the Plugin.Network.Type in the Path? Plugins[0] will still leave it selective.

@rajatchopra done

@dcbw
Copy link
Collaborator Author

dcbw commented Jan 12, 2018

Did we want to expose any other functions meanwhile? Like GetNetwork? so that the library can be used for other purposes?

Maybe let's see if anyone asks for it before we do?

@dcbw dcbw force-pushed the multi-network branch 15 times, most recently from dc8311c to 6f12daf Compare June 8, 2018 21:02
@dcbw dcbw changed the title Add support for multiple pod networks [do not merge] Add support for multiple pod networks Jun 8, 2018
@dcbw
Copy link
Collaborator Author

dcbw commented Jun 8, 2018

Holding off on proposing this for merge until CNI containernetworking/cni#558 lands.

@dcbw dcbw changed the title [do not merge] Add support for multiple pod networks Add support for multiple pod networks Jun 13, 2018
@dcbw
Copy link
Collaborator Author

dcbw commented Jun 20, 2018

@baude @mheon @rajatchopra @cri-o/ocicni-maintainers PTAL thanks!

@rhatdan
Copy link
Contributor

rhatdan commented Jun 20, 2018

Thought this was under CRI-O...

@dcbw dcbw requested review from mrunalp and runcom June 20, 2018 19:04
dcbw added a commit to dcbw/libpod that referenced this pull request Jun 20, 2018
@mrunalp
Copy link
Member

mrunalp commented Jul 11, 2018

@dcbw Can your rebase?

dcbw added 4 commits July 11, 2018 22:37
07c1a6da47b7fbf8b357f4949ecce2113e598491 (0.7.0-alpha1)
Ginkgo: 7f8ab55aaf3b86885aa55b762e803744d1674700 (v1.2.0-29-g7f8ab55)
Gomega: 2152b45fa28a361beba9aab0885972323a444e28 (v1.0-71-g2152b45)
PodNetwork has a new member "Networks" which takes an array of
strings. These map to CNI configuration network names (the "name"
field of CNI config JSON).

If Networks is left empty, then the previous behavior of using
the first found config in /etc/cni/net.d still happens.

Signed-off-by: Dan Williams <[email protected]>
@dcbw
Copy link
Collaborator Author

dcbw commented Jul 12, 2018

@mrunalp done, new commit added (missing default network...)

@rhatdan
Copy link
Contributor

rhatdan commented Jul 12, 2018

@dcbw Tests think you need to gofmt your code.

dcbw added 4 commits July 12, 2018 09:06
We should only look in a single directory for config files, but
allow the user to specify multiple binary directories (like
vendor-specific ones) in which to look for plugin binaries.

Parly ports of Kubernetes changes:

69ac723b78464b9474f9c069bbfd3dbbdbd19239 cni: convert "vendor" option to multiple plugin binary search paths
16eaaaed836ed66fac76f8624d528bc8cd4426bb cni: clarify bin/conf directory variable names

And partly cleanups of the watcher/monitor code to enable
better testing.
It doesn't really need anything from 'plugin' so we might as well
make it more testable.
syncNetworkConfig() would fail to populate the network list if
the default network was not found, which prevents containers
that want non-default networks from being networked.
@dcbw
Copy link
Collaborator Author

dcbw commented Jul 12, 2018

@rhatdan @mrunalp done

@rhatdan
Copy link
Contributor

rhatdan commented Jul 12, 2018

LGTM

1 similar comment
@mrunalp
Copy link
Member

mrunalp commented Jul 12, 2018

LGTM

@mrunalp mrunalp merged commit 0df475a into cri-o:master Jul 12, 2018
@runcom
Copy link
Member

runcom commented Jan 29, 2019

vendoring this in crio produces the following:

go build -i -ldflags '-s -w -X main.gitCommit="47ede695dffc2abd2e7bbf5e4f68ccb78a17fae5-dirty" -X main.buildInfo=1548764930' -tags "     seccomp selinux  containers_image_ostree_stub" -o bin/crio github.com/kubernetes-sigs/cri-o/cmd/crio
# github.com/kubernetes-sigs/cri-o/server
server/sandbox_network.go:29:14: cannot assign []"github.com/kubernetes-sigs/cri-o/vendor/github.com/containernetworking/cni/pkg/types".Result to result (type "github.com/kubernetes-sigs/cri-o/vendor/github.com/containernetworking/cni/pkg/types".Result) in multiple assignment:
	[]"github.com/kubernetes-sigs/cri-o/vendor/github.com/containernetworking/cni/pkg/types".Result does not implement "github.com/kubernetes-sigs/cri-o/vendor/github.com/containernetworking/cni/pkg/types".Result (missing GetAsVersion method)
server/sandbox_network.go:36:13: cannot assign []"github.com/kubernetes-sigs/cri-o/vendor/github.com/containernetworking/cni/pkg/types".Result to podIP (type string) in multiple assignment
server/sandbox_network.go:76:2: cannot use ip (type []"github.com/kubernetes-sigs/cri-o/vendor/github.com/containernetworking/cni/pkg/types".Result) as type string in return argument
make: *** [Makefile:105: bin/crio] Error 2

@dcbw could you help me out? 👼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants