mirror of
https://github.com/containers/podman.git
synced 2025-11-13 01:29:06 +08:00
autocomplete podman search --filter
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
4
vendor/github.com/containers/common/libnetwork/cni/cni_conversion.go
generated
vendored
4
vendor/github.com/containers/common/libnetwork/cni/cni_conversion.go
generated
vendored
@@ -1,5 +1,5 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
//go:build linux || freebsd
|
||||
// +build linux freebsd
|
||||
|
||||
package cni
|
||||
|
||||
|
||||
4
vendor/github.com/containers/common/libnetwork/cni/cni_exec.go
generated
vendored
4
vendor/github.com/containers/common/libnetwork/cni/cni_exec.go
generated
vendored
@@ -16,8 +16,8 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//go:build linux
|
||||
// +build linux
|
||||
//go:build linux || freebsd
|
||||
// +build linux freebsd
|
||||
|
||||
package cni
|
||||
|
||||
|
||||
4
vendor/github.com/containers/common/libnetwork/cni/cni_types.go
generated
vendored
4
vendor/github.com/containers/common/libnetwork/cni/cni_types.go
generated
vendored
@@ -1,5 +1,5 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
//go:build linux || freebsd
|
||||
// +build linux freebsd
|
||||
|
||||
package cni
|
||||
|
||||
|
||||
14
vendor/github.com/containers/common/libnetwork/cni/config.go
generated
vendored
14
vendor/github.com/containers/common/libnetwork/cni/config.go
generated
vendored
@@ -1,5 +1,5 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
//go:build linux || freebsd
|
||||
// +build linux freebsd
|
||||
|
||||
package cni
|
||||
|
||||
@@ -12,7 +12,6 @@ import (
|
||||
pkgutil "github.com/containers/common/pkg/util"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/vishvananda/netlink"
|
||||
)
|
||||
|
||||
// NetworkCreate will take a partial filled Network and fill the
|
||||
@@ -133,14 +132,7 @@ func (n *cniNetwork) NetworkRemove(nameOrID string) error {
|
||||
|
||||
// Remove the bridge network interface on the host.
|
||||
if network.libpodNet.Driver == types.BridgeNetworkDriver {
|
||||
link, err := netlink.LinkByName(network.libpodNet.NetworkInterface)
|
||||
if err == nil {
|
||||
err = netlink.LinkDel(link)
|
||||
// only log the error, it is not fatal
|
||||
if err != nil {
|
||||
logrus.Infof("Failed to remove network interface %s: %v", network.libpodNet.NetworkInterface, err)
|
||||
}
|
||||
}
|
||||
deleteLink(network.libpodNet.NetworkInterface)
|
||||
}
|
||||
|
||||
file := network.filename
|
||||
|
||||
17
vendor/github.com/containers/common/libnetwork/cni/config_freebsd.go
generated
vendored
Normal file
17
vendor/github.com/containers/common/libnetwork/cni/config_freebsd.go
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
//go:build freebsd
|
||||
// +build freebsd
|
||||
|
||||
package cni
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func deleteLink(name string) {
|
||||
if output, err := exec.Command("ifconfig", name, "destroy").CombinedOutput(); err != nil {
|
||||
// only log the error, it is not fatal
|
||||
logrus.Infof("Failed to remove network interface %s: %v: %s", name, err, output)
|
||||
}
|
||||
}
|
||||
20
vendor/github.com/containers/common/libnetwork/cni/config_linux.go
generated
vendored
Normal file
20
vendor/github.com/containers/common/libnetwork/cni/config_linux.go
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
|
||||
package cni
|
||||
|
||||
import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/vishvananda/netlink"
|
||||
)
|
||||
|
||||
func deleteLink(name string) {
|
||||
link, err := netlink.LinkByName(name)
|
||||
if err == nil {
|
||||
err = netlink.LinkDel(link)
|
||||
// only log the error, it is not fatal
|
||||
if err != nil {
|
||||
logrus.Infof("Failed to remove network interface %s: %v", name, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
4
vendor/github.com/containers/common/libnetwork/cni/network.go
generated
vendored
4
vendor/github.com/containers/common/libnetwork/cni/network.go
generated
vendored
@@ -1,5 +1,5 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
//go:build linux || freebsd
|
||||
// +build linux freebsd
|
||||
|
||||
package cni
|
||||
|
||||
|
||||
15
vendor/github.com/containers/common/libnetwork/cni/run.go
generated
vendored
15
vendor/github.com/containers/common/libnetwork/cni/run.go
generated
vendored
@@ -1,5 +1,5 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
//go:build linux || freebsd
|
||||
// +build linux freebsd
|
||||
|
||||
package cni
|
||||
|
||||
@@ -12,13 +12,11 @@ import (
|
||||
"github.com/containernetworking/cni/libcni"
|
||||
cnitypes "github.com/containernetworking/cni/pkg/types"
|
||||
types040 "github.com/containernetworking/cni/pkg/types/040"
|
||||
"github.com/containernetworking/plugins/pkg/ns"
|
||||
"github.com/containers/common/libnetwork/internal/util"
|
||||
"github.com/containers/common/libnetwork/types"
|
||||
"github.com/hashicorp/go-multierror"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/vishvananda/netlink"
|
||||
)
|
||||
|
||||
// Setup will setup the container network namespace. It returns
|
||||
@@ -36,14 +34,7 @@ func (n *cniNetwork) Setup(namespacePath string, options types.SetupOptions) (ma
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// set the loopback adapter up in the container netns
|
||||
err = ns.WithNetNSPath(namespacePath, func(_ ns.NetNS) error {
|
||||
link, err := netlink.LinkByName("lo")
|
||||
if err == nil {
|
||||
err = netlink.LinkSetUp(link)
|
||||
}
|
||||
return err
|
||||
})
|
||||
err = setupLoopback(namespacePath)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to set the loopback adapter up")
|
||||
}
|
||||
|
||||
13
vendor/github.com/containers/common/libnetwork/cni/run_freebsd.go
generated
vendored
Normal file
13
vendor/github.com/containers/common/libnetwork/cni/run_freebsd.go
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
package cni
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
// FreeBSD vnet adds the lo0 interface automatically - we just need to
|
||||
// add the default address. Note: this will also add ::1 as a side
|
||||
// effect.
|
||||
func setupLoopback(namespacePath string) error {
|
||||
// The jexec wrapper runs the ifconfig command inside the jail.
|
||||
return exec.Command("jexec", namespacePath, "ifconfig", "lo0", "inet", "127.0.0.1").Run()
|
||||
}
|
||||
17
vendor/github.com/containers/common/libnetwork/cni/run_linux.go
generated
vendored
Normal file
17
vendor/github.com/containers/common/libnetwork/cni/run_linux.go
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
package cni
|
||||
|
||||
import (
|
||||
"github.com/containernetworking/plugins/pkg/ns"
|
||||
"github.com/vishvananda/netlink"
|
||||
)
|
||||
|
||||
func setupLoopback(namespacePath string) error {
|
||||
// set the loopback adapter up in the container netns
|
||||
return ns.WithNetNSPath(namespacePath, func(_ ns.NetNS) error {
|
||||
link, err := netlink.LinkByName("lo")
|
||||
if err == nil {
|
||||
err = netlink.LinkSetUp(link)
|
||||
}
|
||||
return err
|
||||
})
|
||||
}
|
||||
4
vendor/github.com/containers/common/libnetwork/netavark/config.go
generated
vendored
4
vendor/github.com/containers/common/libnetwork/netavark/config.go
generated
vendored
@@ -1,5 +1,5 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
//go:build linux || freebsd
|
||||
// +build linux freebsd
|
||||
|
||||
package netavark
|
||||
|
||||
|
||||
4
vendor/github.com/containers/common/libnetwork/netavark/const.go
generated
vendored
4
vendor/github.com/containers/common/libnetwork/netavark/const.go
generated
vendored
@@ -1,5 +1,5 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
//go:build linux || freebsd
|
||||
// +build linux freebsd
|
||||
|
||||
package netavark
|
||||
|
||||
|
||||
4
vendor/github.com/containers/common/libnetwork/netavark/exec.go
generated
vendored
4
vendor/github.com/containers/common/libnetwork/netavark/exec.go
generated
vendored
@@ -1,5 +1,5 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
//go:build linux || freebsd
|
||||
// +build linux freebsd
|
||||
|
||||
package netavark
|
||||
|
||||
|
||||
4
vendor/github.com/containers/common/libnetwork/netavark/ipam.go
generated
vendored
4
vendor/github.com/containers/common/libnetwork/netavark/ipam.go
generated
vendored
@@ -1,5 +1,5 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
//go:build linux || freebsd
|
||||
// +build linux freebsd
|
||||
|
||||
package netavark
|
||||
|
||||
|
||||
4
vendor/github.com/containers/common/libnetwork/netavark/network.go
generated
vendored
4
vendor/github.com/containers/common/libnetwork/netavark/network.go
generated
vendored
@@ -1,5 +1,5 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
//go:build linux || freebsd
|
||||
// +build linux freebsd
|
||||
|
||||
package netavark
|
||||
|
||||
|
||||
4
vendor/github.com/containers/common/libnetwork/netavark/run.go
generated
vendored
4
vendor/github.com/containers/common/libnetwork/netavark/run.go
generated
vendored
@@ -1,5 +1,5 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
//go:build linux || freebsd
|
||||
// +build linux freebsd
|
||||
|
||||
package netavark
|
||||
|
||||
|
||||
10
vendor/github.com/containers/common/libnetwork/network/interface.go
generated
vendored
10
vendor/github.com/containers/common/libnetwork/network/interface.go
generated
vendored
@@ -1,5 +1,5 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
//go:build linux || freebsd
|
||||
// +build linux freebsd
|
||||
|
||||
package network
|
||||
|
||||
@@ -25,14 +25,8 @@ import (
|
||||
const (
|
||||
// defaultNetworkBackendFileName is the file name for sentinel file to store the backend
|
||||
defaultNetworkBackendFileName = "defaultNetworkBackend"
|
||||
// cniConfigDir is the directory where cni configuration is found
|
||||
cniConfigDir = "/etc/cni/net.d/"
|
||||
// cniConfigDirRootless is the directory in XDG_CONFIG_HOME for cni plugins
|
||||
cniConfigDirRootless = "cni/net.d/"
|
||||
// netavarkConfigDir is the config directory for the rootful network files
|
||||
netavarkConfigDir = "/etc/containers/networks"
|
||||
// netavarkRunDir is the run directory for the rootful temporary network files such as the ipam db
|
||||
netavarkRunDir = "/run/containers/networks"
|
||||
|
||||
// netavarkBinary is the name of the netavark binary
|
||||
netavarkBinary = "netavark"
|
||||
|
||||
10
vendor/github.com/containers/common/libnetwork/network/interface_freebsd.go
generated
vendored
Normal file
10
vendor/github.com/containers/common/libnetwork/network/interface_freebsd.go
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
package network
|
||||
|
||||
const (
|
||||
// cniConfigDir is the directory where cni configuration is found
|
||||
cniConfigDir = "/usr/local/etc/cni/net.d/"
|
||||
// netavarkConfigDir is the config directory for the rootful network files
|
||||
netavarkConfigDir = "/usr/local/etc/containers/networks"
|
||||
// netavarkRunDir is the run directory for the rootful temporary network files such as the ipam db
|
||||
netavarkRunDir = "/var/run/containers/networks"
|
||||
)
|
||||
10
vendor/github.com/containers/common/libnetwork/network/interface_linux.go
generated
vendored
Normal file
10
vendor/github.com/containers/common/libnetwork/network/interface_linux.go
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
package network
|
||||
|
||||
const (
|
||||
// cniConfigDir is the directory where cni configuration is found
|
||||
cniConfigDir = "/etc/cni/net.d/"
|
||||
// netavarkConfigDir is the config directory for the rootful network files
|
||||
netavarkConfigDir = "/etc/containers/networks"
|
||||
// netavarkRunDir is the run directory for the rootful temporary network files such as the ipam db
|
||||
netavarkRunDir = "/run/containers/networks"
|
||||
)
|
||||
Reference in New Issue
Block a user