diff options
106 files changed, 272 insertions, 127 deletions
diff --git a/cmd/podman/containers/cp.go b/cmd/podman/containers/cp.go index d3b904412..7887e9539 100644 --- a/cmd/podman/containers/cp.go +++ b/cmd/podman/containers/cp.go @@ -121,7 +121,9 @@ func copyFromContainer(container string, containerPath string, hostPath string) return err } + isStdout := false if hostPath == "-" { + isStdout = true hostPath = os.Stdout.Name() } @@ -152,10 +154,16 @@ func copyFromContainer(container string, containerPath string, hostPath string) hostBaseName = filepath.Base(hostInfo.LinkTarget) } + if !isStdout { + if err := validateFileInfo(hostInfo); err != nil { + return errors.Wrap(err, "invalid destination") + } + } + reader, writer := io.Pipe() hostCopy := func() error { defer reader.Close() - if hostInfo.LinkTarget == os.Stdout.Name() { + if isStdout { _, err := io.Copy(os.Stdout, reader) return err } @@ -223,8 +231,6 @@ func copyToContainer(container string, containerPath string, hostPath string) er if hostPath == "-" { hostPath = os.Stdin.Name() isStdin = true - } else if hostPath == os.Stdin.Name() { - isStdin = true } // Make sure that host path exists. @@ -363,3 +369,12 @@ func containerParentDir(container string, containerPath string) (string, error) workDir = filepath.Join(workDir, containerPath) return filepath.Dir(workDir), nil } + +// validateFileInfo returns an error if the specified FileInfo doesn't point to +// a directory or a regular file. +func validateFileInfo(info *copy.FileInfo) error { + if info.Mode.IsDir() || info.Mode.IsRegular() { + return nil + } + return errors.Errorf("%q must be a directory or a regular file", info.LinkTarget) +} diff --git a/libpod/network/files.go b/libpod/network/files.go index f869d32c3..fe483e25c 100644 --- a/libpod/network/files.go +++ b/libpod/network/files.go @@ -81,9 +81,9 @@ func GetCNIConfigPathByNameOrID(config *config.Config, name string) (string, err return "", errors.Wrap(define.ErrNoSuchNetwork, fmt.Sprintf("unable to find network configuration for %s", name)) } -// ReadRawCNIConfByName reads the raw CNI configuration for a CNI +// ReadRawCNIConfByNameOrID reads the raw CNI configuration for a CNI // network by name -func ReadRawCNIConfByName(config *config.Config, name string) ([]byte, error) { +func ReadRawCNIConfByNameOrID(config *config.Config, name string) ([]byte, error) { confFile, err := GetCNIConfigPathByNameOrID(config, name) if err != nil { return nil, err diff --git a/libpod/network/network.go b/libpod/network/network.go index b347ec0e2..f19a764ef 100644 --- a/libpod/network/network.go +++ b/libpod/network/network.go @@ -7,6 +7,7 @@ import ( "net" "os" + "github.com/containernetworking/cni/libcni" "github.com/containernetworking/cni/pkg/types" "github.com/containernetworking/plugins/plugins/ipam/host-local/backend/allocator" "github.com/containers/common/pkg/config" @@ -222,7 +223,7 @@ func RemoveNetwork(config *config.Config, name string) error { // InspectNetwork reads a CNI config and returns its configuration func InspectNetwork(config *config.Config, name string) (map[string]interface{}, error) { - b, err := ReadRawCNIConfByName(config, name) + b, err := ReadRawCNIConfByNameOrID(config, name) if err != nil { return nil, err } @@ -234,7 +235,7 @@ func InspectNetwork(config *config.Config, name string) (map[string]interface{}, // Exists says whether a given network exists or not; it meant // specifically for restful responses so 404s can be used func Exists(config *config.Config, name string) (bool, error) { - _, err := ReadRawCNIConfByName(config, name) + _, err := ReadRawCNIConfByNameOrID(config, name) if err != nil { if errors.Cause(err) == define.ErrNoSuchNetwork { return false, nil @@ -277,3 +278,17 @@ func PruneNetworks(rtc *config.Config, usedNetworks map[string]bool) ([]*entitie } return reports, nil } + +// NormalizeName translates a network ID into a name. +// If the input is a name the name is returned. +func NormalizeName(config *config.Config, nameOrID string) (string, error) { + path, err := GetCNIConfigPathByNameOrID(config, nameOrID) + if err != nil { + return "", err + } + conf, err := libcni.ConfListFromFile(path) + if err != nil { + return "", err + } + return conf.Name, nil +} diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go index 5f9ad0e27..c1b2c694d 100644 --- a/libpod/networking_linux.go +++ b/libpod/networking_linux.go @@ -1139,13 +1139,12 @@ func (c *Container) NetworkDisconnect(nameOrID, netName string, force bool) erro return err } - exists, err := network.Exists(c.runtime.config, netName) + // check if network exists and if the input is a ID we get the name + // ocicni only uses names so it is important that we only use the name + netName, err = network.NormalizeName(c.runtime.config, netName) if err != nil { return err } - if !exists { - return errors.Wrap(define.ErrNoSuchNetwork, netName) - } index, nameExists := networks[netName] if !nameExists && len(networks) > 0 { @@ -1196,13 +1195,12 @@ func (c *Container) NetworkConnect(nameOrID, netName string, aliases []string) e return err } - exists, err := network.Exists(c.runtime.config, netName) + // check if network exists and if the input is a ID we get the name + // ocicni only uses names so it is important that we only use the name + netName, err = network.NormalizeName(c.runtime.config, netName) if err != nil { return err } - if !exists { - return errors.Wrap(define.ErrNoSuchNetwork, netName) - } c.lock.Lock() defer c.lock.Unlock() diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go index af87ccca1..8bf862bf2 100644 --- a/libpod/runtime_ctr.go +++ b/libpod/runtime_ctr.go @@ -12,6 +12,7 @@ import ( "github.com/containers/common/pkg/config" "github.com/containers/podman/v3/libpod/define" "github.com/containers/podman/v3/libpod/events" + "github.com/containers/podman/v3/libpod/network" "github.com/containers/podman/v3/libpod/shutdown" "github.com/containers/podman/v3/pkg/cgroups" "github.com/containers/podman/v3/pkg/domain/entities/reports" @@ -285,6 +286,21 @@ func (r *Runtime) setupContainer(ctx context.Context, ctr *Container) (_ *Contai return nil, err } + // normalize the networks to names + // ocicni only knows about cni names so we have to make + // sure we do not use ids internally + if len(ctr.config.Networks) > 0 { + netNames := make([]string, 0, len(ctr.config.Networks)) + for _, nameOrID := range ctr.config.Networks { + netName, err := network.NormalizeName(r.config, nameOrID) + if err != nil { + return nil, err + } + netNames = append(netNames, netName) + } + ctr.config.Networks = netNames + } + // Inhibit shutdown until creation succeeds shutdown.Inhibit() defer shutdown.Uninhibit() diff --git a/pkg/bindings/containers/types_attach_options.go b/pkg/bindings/containers/types_attach_options.go index 3ab848bbb..cb8f9ea65 100644 --- a/pkg/bindings/containers/types_attach_options.go +++ b/pkg/bindings/containers/types_attach_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_checkpoint_options.go b/pkg/bindings/containers/types_checkpoint_options.go index b0921460a..a2a9a913e 100644 --- a/pkg/bindings/containers/types_checkpoint_options.go +++ b/pkg/bindings/containers/types_checkpoint_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_commit_options.go b/pkg/bindings/containers/types_commit_options.go index f00b1a619..dfb7b2ced 100644 --- a/pkg/bindings/containers/types_commit_options.go +++ b/pkg/bindings/containers/types_commit_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_create_options.go b/pkg/bindings/containers/types_create_options.go index 9fcd16fc1..dd8c82c15 100644 --- a/pkg/bindings/containers/types_create_options.go +++ b/pkg/bindings/containers/types_create_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_diff_options.go b/pkg/bindings/containers/types_diff_options.go index ee4ed009c..ed356335d 100644 --- a/pkg/bindings/containers/types_diff_options.go +++ b/pkg/bindings/containers/types_diff_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_execinspect_options.go b/pkg/bindings/containers/types_execinspect_options.go index aa2ce3976..b14ce9edb 100644 --- a/pkg/bindings/containers/types_execinspect_options.go +++ b/pkg/bindings/containers/types_execinspect_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_execstart_options.go b/pkg/bindings/containers/types_execstart_options.go index e67bb1f02..052270c49 100644 --- a/pkg/bindings/containers/types_execstart_options.go +++ b/pkg/bindings/containers/types_execstart_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_execstartandattach_options.go b/pkg/bindings/containers/types_execstartandattach_options.go index cac23beb1..feda9cc83 100644 --- a/pkg/bindings/containers/types_execstartandattach_options.go +++ b/pkg/bindings/containers/types_execstartandattach_options.go @@ -5,7 +5,7 @@ import ( "io" "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_exists_options.go b/pkg/bindings/containers/types_exists_options.go index efb81679e..a3eefcebf 100644 --- a/pkg/bindings/containers/types_exists_options.go +++ b/pkg/bindings/containers/types_exists_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_export_options.go b/pkg/bindings/containers/types_export_options.go index a47bf93fa..d15904bc1 100644 --- a/pkg/bindings/containers/types_export_options.go +++ b/pkg/bindings/containers/types_export_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_healthcheck_options.go b/pkg/bindings/containers/types_healthcheck_options.go index 1bf251f0b..edad13fee 100644 --- a/pkg/bindings/containers/types_healthcheck_options.go +++ b/pkg/bindings/containers/types_healthcheck_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_init_options.go b/pkg/bindings/containers/types_init_options.go index 6c2e544b9..602608133 100644 --- a/pkg/bindings/containers/types_init_options.go +++ b/pkg/bindings/containers/types_init_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_inspect_options.go b/pkg/bindings/containers/types_inspect_options.go index 30d1e42f1..d1f64ea9a 100644 --- a/pkg/bindings/containers/types_inspect_options.go +++ b/pkg/bindings/containers/types_inspect_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_kill_options.go b/pkg/bindings/containers/types_kill_options.go index 3bcabb71c..60cb4ae2c 100644 --- a/pkg/bindings/containers/types_kill_options.go +++ b/pkg/bindings/containers/types_kill_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_list_options.go b/pkg/bindings/containers/types_list_options.go index 934cbd748..c96b7d880 100644 --- a/pkg/bindings/containers/types_list_options.go +++ b/pkg/bindings/containers/types_list_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_log_options.go b/pkg/bindings/containers/types_log_options.go index 8acefa2aa..63f323089 100644 --- a/pkg/bindings/containers/types_log_options.go +++ b/pkg/bindings/containers/types_log_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_mount_options.go b/pkg/bindings/containers/types_mount_options.go index 1151e108d..a1d8aef62 100644 --- a/pkg/bindings/containers/types_mount_options.go +++ b/pkg/bindings/containers/types_mount_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_mountedcontainerpaths_options.go b/pkg/bindings/containers/types_mountedcontainerpaths_options.go index 4f836f0b9..c4562f43a 100644 --- a/pkg/bindings/containers/types_mountedcontainerpaths_options.go +++ b/pkg/bindings/containers/types_mountedcontainerpaths_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_pause_options.go b/pkg/bindings/containers/types_pause_options.go index bcbc17723..fa2ad4995 100644 --- a/pkg/bindings/containers/types_pause_options.go +++ b/pkg/bindings/containers/types_pause_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_prune_options.go b/pkg/bindings/containers/types_prune_options.go index af8a0fc27..adba0a4ef 100644 --- a/pkg/bindings/containers/types_prune_options.go +++ b/pkg/bindings/containers/types_prune_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_remove_options.go b/pkg/bindings/containers/types_remove_options.go index 90b932bf3..cd4b76ac2 100644 --- a/pkg/bindings/containers/types_remove_options.go +++ b/pkg/bindings/containers/types_remove_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_rename_options.go b/pkg/bindings/containers/types_rename_options.go index bc307abcc..96d9aaab5 100644 --- a/pkg/bindings/containers/types_rename_options.go +++ b/pkg/bindings/containers/types_rename_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_resizeexectty_options.go b/pkg/bindings/containers/types_resizeexectty_options.go index 6dc4b60a7..d74459822 100644 --- a/pkg/bindings/containers/types_resizeexectty_options.go +++ b/pkg/bindings/containers/types_resizeexectty_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_resizetty_options.go b/pkg/bindings/containers/types_resizetty_options.go index c4a6b80fd..68527b330 100644 --- a/pkg/bindings/containers/types_resizetty_options.go +++ b/pkg/bindings/containers/types_resizetty_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_restart_options.go b/pkg/bindings/containers/types_restart_options.go index 993dbae3e..18a47fcb6 100644 --- a/pkg/bindings/containers/types_restart_options.go +++ b/pkg/bindings/containers/types_restart_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_restore_options.go b/pkg/bindings/containers/types_restore_options.go index 3afe71845..ea6c810a2 100644 --- a/pkg/bindings/containers/types_restore_options.go +++ b/pkg/bindings/containers/types_restore_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_shouldrestart_options.go b/pkg/bindings/containers/types_shouldrestart_options.go index 32ede7bac..28986d4f8 100644 --- a/pkg/bindings/containers/types_shouldrestart_options.go +++ b/pkg/bindings/containers/types_shouldrestart_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_start_options.go b/pkg/bindings/containers/types_start_options.go index e247fc4d5..f8ba29623 100644 --- a/pkg/bindings/containers/types_start_options.go +++ b/pkg/bindings/containers/types_start_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_stats_options.go b/pkg/bindings/containers/types_stats_options.go index 0524d1815..8f6a03301 100644 --- a/pkg/bindings/containers/types_stats_options.go +++ b/pkg/bindings/containers/types_stats_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_stop_options.go b/pkg/bindings/containers/types_stop_options.go index c0009b0e7..d952f9c29 100644 --- a/pkg/bindings/containers/types_stop_options.go +++ b/pkg/bindings/containers/types_stop_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_top_options.go b/pkg/bindings/containers/types_top_options.go index cf774ac3d..a80f2111a 100644 --- a/pkg/bindings/containers/types_top_options.go +++ b/pkg/bindings/containers/types_top_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_unmount_options.go b/pkg/bindings/containers/types_unmount_options.go index 4aae72061..6f624081b 100644 --- a/pkg/bindings/containers/types_unmount_options.go +++ b/pkg/bindings/containers/types_unmount_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_unpause_options.go b/pkg/bindings/containers/types_unpause_options.go index 85ad7fb01..d6694d4da 100644 --- a/pkg/bindings/containers/types_unpause_options.go +++ b/pkg/bindings/containers/types_unpause_options.go @@ -3,7 +3,7 @@ package containers import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/containers/types_wait_options.go b/pkg/bindings/containers/types_wait_options.go index fb29f0ea7..ea724b619 100644 --- a/pkg/bindings/containers/types_wait_options.go +++ b/pkg/bindings/containers/types_wait_options.go @@ -4,7 +4,7 @@ import ( "net/url" "github.com/containers/podman/v3/libpod/define" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/generate/types_kube_options.go b/pkg/bindings/generate/types_kube_options.go index 106eed17f..785e55dd4 100644 --- a/pkg/bindings/generate/types_kube_options.go +++ b/pkg/bindings/generate/types_kube_options.go @@ -3,7 +3,7 @@ package generate import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/generate/types_systemd_options.go b/pkg/bindings/generate/types_systemd_options.go index 3e28bd0f1..1cee2e16a 100644 --- a/pkg/bindings/generate/types_systemd_options.go +++ b/pkg/bindings/generate/types_systemd_options.go @@ -3,7 +3,7 @@ package generate import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/generator/generator.go b/pkg/bindings/generator/generator.go index fbca567d0..90f0bfaf5 100644 --- a/pkg/bindings/generator/generator.go +++ b/pkg/bindings/generator/generator.go @@ -81,7 +81,7 @@ func main() { panic(err) } // always add reflect - imports := []string{"\"reflect\"", "\"github.com/containers/podman/v3/pkg/bindings/util\""} + imports := []string{"\"reflect\"", "\"github.com/containers/podman/v3/pkg/bindings/internal/util\""} for _, imp := range f.Imports { imports = append(imports, imp.Path.Value) } diff --git a/pkg/bindings/images/types_diff_options.go b/pkg/bindings/images/types_diff_options.go index 5d7c18cc8..f15a9a696 100644 --- a/pkg/bindings/images/types_diff_options.go +++ b/pkg/bindings/images/types_diff_options.go @@ -3,7 +3,7 @@ package images import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/images/types_exists_options.go b/pkg/bindings/images/types_exists_options.go index 88efb03c8..2326c398b 100644 --- a/pkg/bindings/images/types_exists_options.go +++ b/pkg/bindings/images/types_exists_options.go @@ -3,7 +3,7 @@ package images import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/images/types_export_options.go b/pkg/bindings/images/types_export_options.go index b87c99d12..0c5a3390c 100644 --- a/pkg/bindings/images/types_export_options.go +++ b/pkg/bindings/images/types_export_options.go @@ -3,7 +3,7 @@ package images import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/images/types_get_options.go b/pkg/bindings/images/types_get_options.go index 4d892aa29..33da7b0be 100644 --- a/pkg/bindings/images/types_get_options.go +++ b/pkg/bindings/images/types_get_options.go @@ -3,7 +3,7 @@ package images import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/images/types_history_options.go b/pkg/bindings/images/types_history_options.go index 424fbfd37..191375390 100644 --- a/pkg/bindings/images/types_history_options.go +++ b/pkg/bindings/images/types_history_options.go @@ -3,7 +3,7 @@ package images import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/images/types_import_options.go b/pkg/bindings/images/types_import_options.go index 5eb30adfc..333e841e6 100644 --- a/pkg/bindings/images/types_import_options.go +++ b/pkg/bindings/images/types_import_options.go @@ -3,7 +3,7 @@ package images import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/images/types_list_options.go b/pkg/bindings/images/types_list_options.go index d3d5b2046..e86157f59 100644 --- a/pkg/bindings/images/types_list_options.go +++ b/pkg/bindings/images/types_list_options.go @@ -3,7 +3,7 @@ package images import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/images/types_load_options.go b/pkg/bindings/images/types_load_options.go index 75b5566d6..7b2e504d9 100644 --- a/pkg/bindings/images/types_load_options.go +++ b/pkg/bindings/images/types_load_options.go @@ -3,7 +3,7 @@ package images import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/images/types_prune_options.go b/pkg/bindings/images/types_prune_options.go index 06378b56d..6bd0c0f6f 100644 --- a/pkg/bindings/images/types_prune_options.go +++ b/pkg/bindings/images/types_prune_options.go @@ -3,7 +3,7 @@ package images import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/images/types_pull_options.go b/pkg/bindings/images/types_pull_options.go index 3ea23fc02..0611c4447 100644 --- a/pkg/bindings/images/types_pull_options.go +++ b/pkg/bindings/images/types_pull_options.go @@ -3,7 +3,7 @@ package images import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/images/types_push_options.go b/pkg/bindings/images/types_push_options.go index 3cb3ec937..2593c2fe0 100644 --- a/pkg/bindings/images/types_push_options.go +++ b/pkg/bindings/images/types_push_options.go @@ -3,7 +3,7 @@ package images import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/images/types_remove_options.go b/pkg/bindings/images/types_remove_options.go index 81a717bf8..d591aae88 100644 --- a/pkg/bindings/images/types_remove_options.go +++ b/pkg/bindings/images/types_remove_options.go @@ -3,7 +3,7 @@ package images import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/images/types_search_options.go b/pkg/bindings/images/types_search_options.go index a0e95a0b1..a437a0934 100644 --- a/pkg/bindings/images/types_search_options.go +++ b/pkg/bindings/images/types_search_options.go @@ -3,7 +3,7 @@ package images import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/images/types_tag_options.go b/pkg/bindings/images/types_tag_options.go index 1a0e05640..25cb8f68b 100644 --- a/pkg/bindings/images/types_tag_options.go +++ b/pkg/bindings/images/types_tag_options.go @@ -3,7 +3,7 @@ package images import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/images/types_tree_options.go b/pkg/bindings/images/types_tree_options.go index b03d2282a..43178113d 100644 --- a/pkg/bindings/images/types_tree_options.go +++ b/pkg/bindings/images/types_tree_options.go @@ -3,7 +3,7 @@ package images import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/images/types_untag_options.go b/pkg/bindings/images/types_untag_options.go index a8004b21e..520cf7a49 100644 --- a/pkg/bindings/images/types_untag_options.go +++ b/pkg/bindings/images/types_untag_options.go @@ -3,7 +3,7 @@ package images import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/util/util.go b/pkg/bindings/internal/util/util.go index c1961308e..c1961308e 100644 --- a/pkg/bindings/util/util.go +++ b/pkg/bindings/internal/util/util.go diff --git a/pkg/bindings/manifests/types_add_options.go b/pkg/bindings/manifests/types_add_options.go index 167c42639..09105c590 100644 --- a/pkg/bindings/manifests/types_add_options.go +++ b/pkg/bindings/manifests/types_add_options.go @@ -3,7 +3,7 @@ package manifests import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/manifests/types_create_options.go b/pkg/bindings/manifests/types_create_options.go index e3b549968..5f022c672 100644 --- a/pkg/bindings/manifests/types_create_options.go +++ b/pkg/bindings/manifests/types_create_options.go @@ -3,7 +3,7 @@ package manifests import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/manifests/types_exists_options.go b/pkg/bindings/manifests/types_exists_options.go index 301652d99..6f33c2cd5 100644 --- a/pkg/bindings/manifests/types_exists_options.go +++ b/pkg/bindings/manifests/types_exists_options.go @@ -3,7 +3,7 @@ package manifests import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/manifests/types_inspect_options.go b/pkg/bindings/manifests/types_inspect_options.go index 104fd8469..7dfa11cb4 100644 --- a/pkg/bindings/manifests/types_inspect_options.go +++ b/pkg/bindings/manifests/types_inspect_options.go @@ -3,7 +3,7 @@ package manifests import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/manifests/types_remove_options.go b/pkg/bindings/manifests/types_remove_options.go index 57a5f82ce..7a507cf1a 100644 --- a/pkg/bindings/manifests/types_remove_options.go +++ b/pkg/bindings/manifests/types_remove_options.go @@ -3,7 +3,7 @@ package manifests import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/network/types_connect_options.go b/pkg/bindings/network/types_connect_options.go index f51c31be0..c0e7a6f50 100644 --- a/pkg/bindings/network/types_connect_options.go +++ b/pkg/bindings/network/types_connect_options.go @@ -3,7 +3,7 @@ package network import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/network/types_create_options.go b/pkg/bindings/network/types_create_options.go index 66e155b7a..5746a5b1f 100644 --- a/pkg/bindings/network/types_create_options.go +++ b/pkg/bindings/network/types_create_options.go @@ -4,7 +4,7 @@ import ( "net" "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/network/types_disconnect_options.go b/pkg/bindings/network/types_disconnect_options.go index 37e9f4c72..a73675d4f 100644 --- a/pkg/bindings/network/types_disconnect_options.go +++ b/pkg/bindings/network/types_disconnect_options.go @@ -3,7 +3,7 @@ package network import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/network/types_exists_options.go b/pkg/bindings/network/types_exists_options.go index 4861343b6..4f33cdfbb 100644 --- a/pkg/bindings/network/types_exists_options.go +++ b/pkg/bindings/network/types_exists_options.go @@ -3,7 +3,7 @@ package network import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/network/types_inspect_options.go b/pkg/bindings/network/types_inspect_options.go index 6022ae111..9f7497ed5 100644 --- a/pkg/bindings/network/types_inspect_options.go +++ b/pkg/bindings/network/types_inspect_options.go @@ -3,7 +3,7 @@ package network import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/network/types_list_options.go b/pkg/bindings/network/types_list_options.go index c922dcf8e..fcbe23bd6 100644 --- a/pkg/bindings/network/types_list_options.go +++ b/pkg/bindings/network/types_list_options.go @@ -3,7 +3,7 @@ package network import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/network/types_prune_options.go b/pkg/bindings/network/types_prune_options.go index ae26dbece..84e1a8b32 100644 --- a/pkg/bindings/network/types_prune_options.go +++ b/pkg/bindings/network/types_prune_options.go @@ -3,7 +3,7 @@ package network import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/network/types_remove_options.go b/pkg/bindings/network/types_remove_options.go index 7e3265924..f715c94c9 100644 --- a/pkg/bindings/network/types_remove_options.go +++ b/pkg/bindings/network/types_remove_options.go @@ -3,7 +3,7 @@ package network import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/play/types_kube_options.go b/pkg/bindings/play/types_kube_options.go index d290ceb34..78396a090 100644 --- a/pkg/bindings/play/types_kube_options.go +++ b/pkg/bindings/play/types_kube_options.go @@ -3,7 +3,7 @@ package play import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/pods/types_create_options.go b/pkg/bindings/pods/types_create_options.go index a29c24794..891ef2e84 100644 --- a/pkg/bindings/pods/types_create_options.go +++ b/pkg/bindings/pods/types_create_options.go @@ -3,7 +3,7 @@ package pods import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/pods/types_exists_options.go b/pkg/bindings/pods/types_exists_options.go index e235fad37..02423e7ed 100644 --- a/pkg/bindings/pods/types_exists_options.go +++ b/pkg/bindings/pods/types_exists_options.go @@ -3,7 +3,7 @@ package pods import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/pods/types_inspect_options.go b/pkg/bindings/pods/types_inspect_options.go index a78337015..20ec3a726 100644 --- a/pkg/bindings/pods/types_inspect_options.go +++ b/pkg/bindings/pods/types_inspect_options.go @@ -3,7 +3,7 @@ package pods import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/pods/types_kill_options.go b/pkg/bindings/pods/types_kill_options.go index 7a9714bfd..fabd45c67 100644 --- a/pkg/bindings/pods/types_kill_options.go +++ b/pkg/bindings/pods/types_kill_options.go @@ -3,7 +3,7 @@ package pods import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/pods/types_list_options.go b/pkg/bindings/pods/types_list_options.go index cb9bbc5a6..7221c7ff8 100644 --- a/pkg/bindings/pods/types_list_options.go +++ b/pkg/bindings/pods/types_list_options.go @@ -3,7 +3,7 @@ package pods import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/pods/types_pause_options.go b/pkg/bindings/pods/types_pause_options.go index 91a12b76b..0bbc9c293 100644 --- a/pkg/bindings/pods/types_pause_options.go +++ b/pkg/bindings/pods/types_pause_options.go @@ -3,7 +3,7 @@ package pods import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/pods/types_prune_options.go b/pkg/bindings/pods/types_prune_options.go index 6740a22ba..0e788f471 100644 --- a/pkg/bindings/pods/types_prune_options.go +++ b/pkg/bindings/pods/types_prune_options.go @@ -3,7 +3,7 @@ package pods import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/pods/types_remove_options.go b/pkg/bindings/pods/types_remove_options.go index bf1096955..3d3c7ad2a 100644 --- a/pkg/bindings/pods/types_remove_options.go +++ b/pkg/bindings/pods/types_remove_options.go @@ -3,7 +3,7 @@ package pods import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/pods/types_restart_options.go b/pkg/bindings/pods/types_restart_options.go index ace0a0cbd..9278b7b46 100644 --- a/pkg/bindings/pods/types_restart_options.go +++ b/pkg/bindings/pods/types_restart_options.go @@ -3,7 +3,7 @@ package pods import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/pods/types_start_options.go b/pkg/bindings/pods/types_start_options.go index 37bc93ffc..d0cb50969 100644 --- a/pkg/bindings/pods/types_start_options.go +++ b/pkg/bindings/pods/types_start_options.go @@ -3,7 +3,7 @@ package pods import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/pods/types_stats_options.go b/pkg/bindings/pods/types_stats_options.go index 257dab50c..2fb3529ad 100644 --- a/pkg/bindings/pods/types_stats_options.go +++ b/pkg/bindings/pods/types_stats_options.go @@ -3,7 +3,7 @@ package pods import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/pods/types_stop_options.go b/pkg/bindings/pods/types_stop_options.go index f43317275..443c9120f 100644 --- a/pkg/bindings/pods/types_stop_options.go +++ b/pkg/bindings/pods/types_stop_options.go @@ -3,7 +3,7 @@ package pods import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/pods/types_top_options.go b/pkg/bindings/pods/types_top_options.go index 6526d9879..ab6501704 100644 --- a/pkg/bindings/pods/types_top_options.go +++ b/pkg/bindings/pods/types_top_options.go @@ -3,7 +3,7 @@ package pods import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/pods/types_unpause_options.go b/pkg/bindings/pods/types_unpause_options.go index 67e7d45d6..f9ea972e6 100644 --- a/pkg/bindings/pods/types_unpause_options.go +++ b/pkg/bindings/pods/types_unpause_options.go @@ -3,7 +3,7 @@ package pods import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/secrets/types_create_options.go b/pkg/bindings/secrets/types_create_options.go index af4516c35..ea5bd3039 100644 --- a/pkg/bindings/secrets/types_create_options.go +++ b/pkg/bindings/secrets/types_create_options.go @@ -3,7 +3,7 @@ package secrets import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/secrets/types_inspect_options.go b/pkg/bindings/secrets/types_inspect_options.go index 75831841d..48c2737d0 100644 --- a/pkg/bindings/secrets/types_inspect_options.go +++ b/pkg/bindings/secrets/types_inspect_options.go @@ -3,7 +3,7 @@ package secrets import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/secrets/types_list_options.go b/pkg/bindings/secrets/types_list_options.go index 14dcd761c..568e021a8 100644 --- a/pkg/bindings/secrets/types_list_options.go +++ b/pkg/bindings/secrets/types_list_options.go @@ -3,7 +3,7 @@ package secrets import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/secrets/types_remove_options.go b/pkg/bindings/secrets/types_remove_options.go index 3da8e8485..dd5ac530a 100644 --- a/pkg/bindings/secrets/types_remove_options.go +++ b/pkg/bindings/secrets/types_remove_options.go @@ -3,7 +3,7 @@ package secrets import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/system/types_disk_options.go b/pkg/bindings/system/types_disk_options.go index 3a7474502..d55139b68 100644 --- a/pkg/bindings/system/types_disk_options.go +++ b/pkg/bindings/system/types_disk_options.go @@ -3,7 +3,7 @@ package system import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/system/types_events_options.go b/pkg/bindings/system/types_events_options.go index b430c99fd..8b4cff42c 100644 --- a/pkg/bindings/system/types_events_options.go +++ b/pkg/bindings/system/types_events_options.go @@ -3,7 +3,7 @@ package system import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/system/types_info_options.go b/pkg/bindings/system/types_info_options.go index 5fa8fd37d..2bbb95a2e 100644 --- a/pkg/bindings/system/types_info_options.go +++ b/pkg/bindings/system/types_info_options.go @@ -3,7 +3,7 @@ package system import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/system/types_prune_options.go b/pkg/bindings/system/types_prune_options.go index 47093a910..f4daa830a 100644 --- a/pkg/bindings/system/types_prune_options.go +++ b/pkg/bindings/system/types_prune_options.go @@ -3,7 +3,7 @@ package system import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/system/types_version_options.go b/pkg/bindings/system/types_version_options.go index 3bfb85c3b..5e01da583 100644 --- a/pkg/bindings/system/types_version_options.go +++ b/pkg/bindings/system/types_version_options.go @@ -3,7 +3,7 @@ package system import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/volumes/types_create_options.go b/pkg/bindings/volumes/types_create_options.go index 5ff1615ec..0e8274d25 100644 --- a/pkg/bindings/volumes/types_create_options.go +++ b/pkg/bindings/volumes/types_create_options.go @@ -3,7 +3,7 @@ package volumes import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/volumes/types_exists_options.go b/pkg/bindings/volumes/types_exists_options.go index 396975cb8..b58b93f38 100644 --- a/pkg/bindings/volumes/types_exists_options.go +++ b/pkg/bindings/volumes/types_exists_options.go @@ -3,7 +3,7 @@ package volumes import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/volumes/types_inspect_options.go b/pkg/bindings/volumes/types_inspect_options.go index 9bc3969b0..81bed1363 100644 --- a/pkg/bindings/volumes/types_inspect_options.go +++ b/pkg/bindings/volumes/types_inspect_options.go @@ -3,7 +3,7 @@ package volumes import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/volumes/types_list_options.go b/pkg/bindings/volumes/types_list_options.go index ddaf8dd91..9b2c6a3ad 100644 --- a/pkg/bindings/volumes/types_list_options.go +++ b/pkg/bindings/volumes/types_list_options.go @@ -3,7 +3,7 @@ package volumes import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/volumes/types_prune_options.go b/pkg/bindings/volumes/types_prune_options.go index 474714fa5..5d52752f2 100644 --- a/pkg/bindings/volumes/types_prune_options.go +++ b/pkg/bindings/volumes/types_prune_options.go @@ -3,7 +3,7 @@ package volumes import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/bindings/volumes/types_remove_options.go b/pkg/bindings/volumes/types_remove_options.go index 09651e424..5e3fde58a 100644 --- a/pkg/bindings/volumes/types_remove_options.go +++ b/pkg/bindings/volumes/types_remove_options.go @@ -3,7 +3,7 @@ package volumes import ( "net/url" - "github.com/containers/podman/v3/pkg/bindings/util" + "github.com/containers/podman/v3/pkg/bindings/internal/util" ) /* diff --git a/pkg/cgroups/cgroups.go b/pkg/cgroups/cgroups.go index f563c51a8..608e1647a 100644 --- a/pkg/cgroups/cgroups.go +++ b/pkg/cgroups/cgroups.go @@ -331,18 +331,24 @@ func Load(path string) (*CgroupControl, error) { control.additionalControllers = controllers } if !cgroup2 { + oneExists := false + // check that the cgroup exists at least under one controller for name := range handlers { p := control.getCgroupv1Path(name) - if _, err := os.Stat(p); err != nil { - if os.IsNotExist(err) { - if rootless.IsRootless() { - return nil, ErrCgroupV1Rootless - } - // compatible with the error code - // used by containerd/cgroups - return nil, ErrCgroupDeleted - } + if _, err := os.Stat(p); err == nil { + oneExists = true + break + } + } + + // if there is no controller at all, raise an error + if !oneExists { + if rootless.IsRootless() { + return nil, ErrCgroupV1Rootless } + // compatible with the error code + // used by containerd/cgroups + return nil, ErrCgroupDeleted } } return control, nil diff --git a/test/e2e/create_test.go b/test/e2e/create_test.go index 43da95a9d..1f1786dbe 100644 --- a/test/e2e/create_test.go +++ b/test/e2e/create_test.go @@ -9,6 +9,7 @@ import ( "strings" . "github.com/containers/podman/v3/test/utils" + "github.com/containers/storage/pkg/stringid" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) @@ -576,15 +577,20 @@ var _ = Describe("Podman create", func() { Expect(session.ExitCode()).ToNot(BeZero()) }) - It("create container in pod with network should fail", func() { + It("create container in pod with network should not fail", func() { name := "createwithnetwork" pod := podmanTest.RunTopContainerInPod("", "new:"+name) pod.WaitWithDefaultTimeout() Expect(pod.ExitCode()).To(BeZero()) - session := podmanTest.Podman([]string{"create", "--pod", name, "--network", "foobar", ALPINE, "top"}) + netName := "pod" + stringid.GenerateNonCryptoID() + session := podmanTest.Podman([]string{"network", "create", netName}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(BeZero()) + defer podmanTest.removeCNINetwork(netName) + + session = podmanTest.Podman([]string{"create", "--pod", name, "--network", netName, ALPINE, "top"}) session.WaitWithDefaultTimeout() - //Expect(session.ExitCode()).ToNot(BeZero()) Expect(session.ExitCode()).To(BeZero()) }) diff --git a/test/e2e/network_connect_disconnect_test.go b/test/e2e/network_connect_disconnect_test.go index ab42a592f..3be95e254 100644 --- a/test/e2e/network_connect_disconnect_test.go +++ b/test/e2e/network_connect_disconnect_test.go @@ -195,6 +195,55 @@ var _ = Describe("Podman network connect and disconnect", func() { Expect(exec.ExitCode()).To(BeZero()) }) + It("podman network connect and run with network ID", func() { + SkipIfRemote("remote flakes to much I will fix this in another PR") + SkipIfRootless("network connect and disconnect are only rootful") + netName := "ID" + stringid.GenerateNonCryptoID() + session := podmanTest.Podman([]string{"network", "create", netName}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(BeZero()) + defer podmanTest.removeCNINetwork(netName) + + session = podmanTest.Podman([]string{"network", "ls", "--format", "{{.ID}}", "--filter", "name=" + netName}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(BeZero()) + netID := session.OutputToString() + + ctr := podmanTest.Podman([]string{"run", "-dt", "--name", "test", "--network", netID, ALPINE, "top"}) + ctr.WaitWithDefaultTimeout() + Expect(ctr.ExitCode()).To(BeZero()) + + exec := podmanTest.Podman([]string{"exec", "-it", "test", "ip", "addr", "show", "eth0"}) + exec.WaitWithDefaultTimeout() + Expect(exec.ExitCode()).To(BeZero()) + + // Create a second network + newNetName := "ID2" + stringid.GenerateNonCryptoID() + session = podmanTest.Podman([]string{"network", "create", newNetName}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(BeZero()) + defer podmanTest.removeCNINetwork(newNetName) + + session = podmanTest.Podman([]string{"network", "ls", "--format", "{{.ID}}", "--filter", "name=" + newNetName}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(BeZero()) + newNetID := session.OutputToString() + + connect := podmanTest.Podman([]string{"network", "connect", newNetID, "test"}) + connect.WaitWithDefaultTimeout() + Expect(connect.ExitCode()).To(BeZero()) + + inspect := podmanTest.Podman([]string{"container", "inspect", "test", "--format", "{{.NetworkSettings.Networks}}"}) + inspect.WaitWithDefaultTimeout() + Expect(inspect.ExitCode()).To(BeZero()) + Expect(inspect.OutputToString()).To(ContainSubstring(netName)) + Expect(inspect.OutputToString()).To(ContainSubstring(newNetName)) + + exec = podmanTest.Podman([]string{"exec", "-it", "test", "ip", "addr", "show", "eth1"}) + exec.WaitWithDefaultTimeout() + Expect(exec.ExitCode()).To(BeZero()) + }) + It("podman network disconnect when not running", func() { SkipIfRootless("network connect and disconnect are only rootful") netName1 := "aliasTest" + stringid.GenerateNonCryptoID() @@ -234,4 +283,40 @@ var _ = Describe("Podman network connect and disconnect", func() { exec.WaitWithDefaultTimeout() Expect(exec.ExitCode()).ToNot(BeZero()) }) + + It("podman network disconnect and run with network ID", func() { + SkipIfRemote("remote flakes to much I will fix this in another PR") + SkipIfRootless("network connect and disconnect are only rootful") + netName := "aliasTest" + stringid.GenerateNonCryptoID() + session := podmanTest.Podman([]string{"network", "create", netName}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(BeZero()) + defer podmanTest.removeCNINetwork(netName) + + session = podmanTest.Podman([]string{"network", "ls", "--format", "{{.ID}}", "--filter", "name=" + netName}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(BeZero()) + netID := session.OutputToString() + + ctr := podmanTest.Podman([]string{"run", "-dt", "--name", "test", "--network", netID, ALPINE, "top"}) + ctr.WaitWithDefaultTimeout() + Expect(ctr.ExitCode()).To(BeZero()) + + exec := podmanTest.Podman([]string{"exec", "-it", "test", "ip", "addr", "show", "eth0"}) + exec.WaitWithDefaultTimeout() + Expect(exec.ExitCode()).To(BeZero()) + + dis := podmanTest.Podman([]string{"network", "disconnect", netID, "test"}) + dis.WaitWithDefaultTimeout() + Expect(dis.ExitCode()).To(BeZero()) + + inspect := podmanTest.Podman([]string{"container", "inspect", "test", "--format", "{{len .NetworkSettings.Networks}}"}) + inspect.WaitWithDefaultTimeout() + Expect(inspect.ExitCode()).To(BeZero()) + Expect(inspect.OutputToString()).To(Equal("0")) + + exec = podmanTest.Podman([]string{"exec", "-it", "test", "ip", "addr", "show", "eth0"}) + exec.WaitWithDefaultTimeout() + Expect(exec.ExitCode()).ToNot(BeZero()) + }) }) diff --git a/test/system/065-cp.bats b/test/system/065-cp.bats index 0fcc437d4..312106b36 100644 --- a/test/system/065-cp.bats +++ b/test/system/065-cp.bats @@ -475,9 +475,9 @@ load helpers run_podman exec cpcontainer rm -rf /tmp/$srcdir # Now for "/dev/stdin". + # Note: while this works, the content ends up in Nirvana. + # Same for Docker. run_podman cp /dev/stdin cpcontainer:/tmp < $tar_file - run_podman exec cpcontainer cat /tmp/$srcdir/$rand_filename - is "$output" "$rand_content" # Error checks below ... @@ -487,11 +487,11 @@ load helpers # Destination must be a directory (on an existing file). run_podman exec cpcontainer touch /tmp/file.txt - run_podman 125 cp /dev/stdin cpcontainer:/tmp/file.txt < $tar_file + run_podman 125 cp - cpcontainer:/tmp/file.txt < $tar_file is "$output" 'Error: destination must be a directory when copying from stdin' # Destination must be a directory (on an absent path). - run_podman 125 cp /dev/stdin cpcontainer:/tmp/IdoNotExist < $tar_file + run_podman 125 cp - cpcontainer:/tmp/IdoNotExist < $tar_file is "$output" 'Error: destination must be a directory when copying from stdin' run_podman rm -f cpcontainer @@ -508,6 +508,10 @@ load helpers run_podman exec cpcontainer sh -c "echo '$rand_content' > /tmp/file.txt" run_podman exec cpcontainer touch /tmp/empty.txt + # Make sure that only "-" gets special treatment. "/dev/stdout" + run_podman 125 cp cpcontainer:/tmp/file.txt /dev/stdout + is "$output" 'Error: invalid destination: "/dev/stdout" must be a directory or a regular file' + # Copying from stdout will always compress. So let's copy the previously # created file from the container via stdout, untar the archive and make # sure the file exists with the expected content. |