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

podman network create #3862

Merged
merged 1 commit into from
Sep 9, 2019
Merged

Conversation

baude
Copy link
Member

@baude baude commented Aug 20, 2019

initial implementation of network create. we only support bridging
networks with this first pass.

Signed-off-by: baude [email protected]

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: baude

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 20, 2019
@baude baude force-pushed the networkcreate branch 8 times, most recently from b51eaaf to 36f4a33 Compare August 21, 2019 15:43
docs/podman-network-create.1.md Outdated Show resolved Hide resolved
docs/podman-network-create.1.md Outdated Show resolved Hide resolved
Create a network with no options
```
# podman network create
/etc/cni/net.d/cni-podman-4.conflist
Copy link
Member

Choose a reason for hiding this comment

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

Why not just podman-4.conflist, I don't see a vailue in prefixing this with cni, since we are already in the /etc/cni subdir

Copy link
Member Author

Choose a reason for hiding this comment

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

this was agreed with @mheon ...

pkg/adapter/network.go Show resolved Hide resolved
pkg/adapter/network.go Outdated Show resolved Hide resolved
pkg/network/config.go Show resolved Hide resolved
pkg/network/devices.go Outdated Show resolved Hide resolved
pkg/network/devices.go Outdated Show resolved Hide resolved
pkg/network/subnet.go Outdated Show resolved Hide resolved
pkg/network/subnet.go Outdated Show resolved Hide resolved
cmd/podman/network.go Outdated Show resolved Hide resolved
cmd/podman/network_create.go Outdated Show resolved Hide resolved
cmd/podman/network_create.go Outdated Show resolved Hide resolved
pkg/adapter/network.go Outdated Show resolved Hide resolved
pkg/network/config.go Outdated Show resolved Hide resolved
pkg/network/config.go Outdated Show resolved Hide resolved
)

// LoadCNIConfsFromDir loads all the CNI configurations from a dir
func LoadCNIConfsFromDir(dir string) ([]*libcni.NetworkConfigList, error) {
Copy link
Member

Choose a reason for hiding this comment

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

I feel like we might want to wrap this in a sync.Once so we don't repeatedly reread the configs

Copy link
Member Author

Choose a reason for hiding this comment

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

?? lets talk on Monday

@baude baude force-pushed the networkcreate branch 2 times, most recently from e4fa4cf to e02fd5d Compare August 26, 2019 14:28
@rhatdan
Copy link
Member

rhatdan commented Aug 27, 2019

LGTM
@mheon @TomSweeneyRedHat @giuseppe @vrothberg PTAL

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

A couple of nits and comments below. Will start playing with the PR now.

cmd/podman/network_create.go Outdated Show resolved Hide resolved
commands.md Outdated Show resolved Hide resolved
cmd/podman/network_create.go Outdated Show resolved Hide resolved
cmd/podman/network_create.go Outdated Show resolved Hide resolved
completions/bash/podman Show resolved Hide resolved
pkg/network/config.go Show resolved Hide resolved
pkg/network/config.go Show resolved Hide resolved
pkg/network/devices.go Outdated Show resolved Hide resolved
pkg/network/devices.go Outdated Show resolved Hide resolved
test/e2e/network_create_test.go Outdated Show resolved Hide resolved
@vrothberg
Copy link
Member

One thing I noticed is a difference in the naming scheme:

[libpod (pull-request-3862)]$ sudo ./bin/podman network create -d bridge
/etc/cni/net.d/cni-podman-0.conflist                                    

[libpod (pull-request-3862)]$ ls /etc/cni/net.d/
100-crio-bridge.conf  200-loopback.conf  87-podman-bridge.conflist  cni-podman-0.conflist

I suggest following the exisiting convention of $NUM-$TOOL-$DRIVER.conflist - unless there's a specific reason not to.

@vrothberg
Copy link
Member

I tried using the generated network but it failed since it can't find a default network.

Changing the "name" from "cni-podman0" to "podman" in the generated config fixed it. Is this intended/expected?

Copy link
Member Author

@baude baude left a comment

Choose a reason for hiding this comment

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

I tried using the generated network but it failed since it can't find a default network.

Changing the "name" from "cni-podman0" to "podman" in the generated config fixed it. Is this intended/expected?

the defaultnetwork needs to be documented in the conf file && actually honored. @mheon and i need to huddle on it once we merge this.

@baude baude force-pushed the networkcreate branch 2 times, most recently from bbf4c48 to 3fd319f Compare September 1, 2019 15:20
@rh-atomic-bot
Copy link
Collaborator

☔ The latest upstream changes (presumably #3876) made this pull request unmergeable. Please resolve the merge conflicts.

@baude baude force-pushed the networkcreate branch 2 times, most recently from ad9a845 to e5f6afd Compare September 8, 2019 15:47
@baude
Copy link
Member Author

baude commented Sep 8, 2019

@edsantiago do you understand whats going on with the gating failure? it was passing and i rebased and now fails.

@vrothberg
Copy link
Member

vrothberg commented Sep 9, 2019

@edsantiago do you understand whats going on with the gating failure? it was passing and i rebased and now fails.

cd $GOSRC && ./hack/man-page-checker |& ${TIMESTAMP}
[15:51:24] START - All [+xxxx] lines that follow are relative to right now.
[+0001s] podman-network-create.1.md        NAME= podman-network-create-
[+0002s] 
[+0002s]   podman-network-create.1.md       = 'podman\-network-create- Create a Podman CNI network'
[+0002s]   podman-network.1.md              = 'Create a CNI network for Podman'

I guess the problem is the trailing dash in podman\-network-create- . Maybe we can keep the descriptions consistent between podman-network and podman-network-create?

diff --git a/docs/podman-network-create.1.md b/docs/podman-network-create.1.md
index 45701bfc2f56..4c7cc7ef06d3 100644
--- a/docs/podman-network-create.1.md
+++ b/docs/podman-network-create.1.md
@@ -1,7 +1,7 @@
 % podman-network-create(1)
 
 ## NAME
-podman\-network-create- Create a Podman CNI network
+podman\-network\-create - Create a CNI network for Podman
 
 ## SYNOPSIS
 **podman network create**  [*options*] name

initial implementation of network create.  we only support bridging
networks with this first pass.

Signed-off-by: baude <[email protected]>
@mheon
Copy link
Member

mheon commented Sep 9, 2019

LGTM

@rhatdan
Copy link
Member

rhatdan commented Sep 9, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 9, 2019
@openshift-merge-robot openshift-merge-robot merged commit 7042a3d into containers:master Sep 9, 2019
@AkihiroSuda
Copy link
Collaborator

Will this be available in v1.5.2? Or v1.6.0?

@vrothberg
Copy link
Member

It will be available in v1.6.0. There won't be a 1.5.2.

@rhatdan
Copy link
Member

rhatdan commented Sep 11, 2019

@AkihiroSuda Goal is to cut 1.6.0 on Friday.

@baude baude deleted the networkcreate branch December 22, 2019 18:58
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants