summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.golangci.yml1
-rw-r--r--cmd/podman/containers/create.go19
-rw-r--r--cmd/podman/containers/run.go2
-rw-r--r--cmd/podman/system/connection/add.go4
-rw-r--r--libpod/container_api.go6
-rw-r--r--libpod/container_copy_linux.go13
-rw-r--r--libpod/container_internal_linux.go32
-rw-r--r--libpod/container_internal_linux_test.go8
-rw-r--r--libpod/container_stat_linux.go13
-rw-r--r--libpod/networking_linux.go40
-rw-r--r--libpod/networking_linux_test.go11
-rw-r--r--libpod/oci_conmon_exec_linux.go2
-rw-r--r--libpod/oci_conmon_linux.go4
-rw-r--r--libpod/runtime.go12
-rw-r--r--libpod/runtime_ctr.go2
-rw-r--r--libpod/runtime_migrate.go3
-rw-r--r--libpod/runtime_volume_linux.go4
-rw-r--r--pkg/autoupdate/autoupdate.go4
-rw-r--r--pkg/domain/infra/abi/play.go4
-rw-r--r--pkg/machine/fcos.go2
-rw-r--r--pkg/specgen/generate/container_create.go8
-rw-r--r--pkg/specgen/generate/namespaces.go7
-rw-r--r--pkg/specgen/generate/oci.go12
-rw-r--r--pkg/specgen/generate/pod_create.go6
-rw-r--r--pkg/specgen/generate/ports.go3
-rw-r--r--pkg/specgenutil/specgen.go4
-rw-r--r--test/e2e/common_test.go6
-rw-r--r--test/e2e/play_kube_test.go4
-rw-r--r--test/e2e/run_aardvark_test.go30
-rw-r--r--test/testvol/main.go9
30 files changed, 118 insertions, 157 deletions
diff --git a/.golangci.yml b/.golangci.yml
index 8a922775a..582a38206 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -34,7 +34,6 @@ linters:
- ifshort
- forbidigo
- exhaustive
- - unparam
- gofumpt
- gci
- godot
diff --git a/cmd/podman/containers/create.go b/cmd/podman/containers/create.go
index b202e404f..29e138e30 100644
--- a/cmd/podman/containers/create.go
+++ b/cmd/podman/containers/create.go
@@ -142,7 +142,7 @@ func create(cmd *cobra.Command, args []string) error {
}
s.RawImageName = rawImageName
- if _, err := createPodIfNecessary(cmd, s, cliVals.Net); err != nil {
+ if err := createPodIfNecessary(cmd, s, cliVals.Net); err != nil {
return err
}
@@ -345,13 +345,13 @@ func PullImage(imageName string, cliVals entities.ContainerCreateOptions) (strin
// createPodIfNecessary automatically creates a pod when requested. if the pod name
// has the form new:ID, the pod ID is created and the name in the spec generator is replaced
// with ID.
-func createPodIfNecessary(cmd *cobra.Command, s *specgen.SpecGenerator, netOpts *entities.NetOptions) (*entities.PodCreateReport, error) {
+func createPodIfNecessary(cmd *cobra.Command, s *specgen.SpecGenerator, netOpts *entities.NetOptions) error {
if !strings.HasPrefix(s.Pod, "new:") {
- return nil, nil
+ return nil
}
podName := strings.Replace(s.Pod, "new:", "", 1)
if len(podName) < 1 {
- return nil, errors.Errorf("new pod name must be at least one character")
+ return errors.Errorf("new pod name must be at least one character")
}
var err error
@@ -359,7 +359,7 @@ func createPodIfNecessary(cmd *cobra.Command, s *specgen.SpecGenerator, netOpts
if cliVals.UserNS != "" {
uns, err = specgen.ParseNamespace(cliVals.UserNS)
if err != nil {
- return nil, err
+ return err
}
}
createOptions := entities.PodCreateOptions{
@@ -383,7 +383,7 @@ func createPodIfNecessary(cmd *cobra.Command, s *specgen.SpecGenerator, netOpts
podSpec.PodSpecGen = *podGen
podGen, err = entities.ToPodSpecGen(podSpec.PodSpecGen, &createOptions)
if err != nil {
- return nil, err
+ return err
}
infraOpts := entities.NewInfraContainerCreateOptions()
@@ -391,14 +391,15 @@ func createPodIfNecessary(cmd *cobra.Command, s *specgen.SpecGenerator, netOpts
infraOpts.Quiet = true
infraOpts.Hostname, err = cmd.Flags().GetString("hostname")
if err != nil {
- return nil, err
+ return err
}
podGen.InfraContainerSpec = specgen.NewSpecGenerator("", false)
podGen.InfraContainerSpec.NetworkOptions = podGen.NetworkOptions
err = specgenutil.FillOutSpecGen(podGen.InfraContainerSpec, &infraOpts, []string{})
if err != nil {
- return nil, err
+ return err
}
podSpec.PodSpecGen = *podGen
- return registry.ContainerEngine().PodCreate(context.Background(), podSpec)
+ _, err = registry.ContainerEngine().PodCreate(context.Background(), podSpec)
+ return err
}
diff --git a/cmd/podman/containers/run.go b/cmd/podman/containers/run.go
index 4ad8d3183..951981293 100644
--- a/cmd/podman/containers/run.go
+++ b/cmd/podman/containers/run.go
@@ -197,7 +197,7 @@ func run(cmd *cobra.Command, args []string) error {
s.Passwd = &runOpts.Passwd
runOpts.Spec = s
- if _, err := createPodIfNecessary(cmd, s, cliVals.Net); err != nil {
+ if err := createPodIfNecessary(cmd, s, cliVals.Net); err != nil {
return err
}
diff --git a/cmd/podman/system/connection/add.go b/cmd/podman/system/connection/add.go
index db575a689..387de3c58 100644
--- a/cmd/podman/system/connection/add.go
+++ b/cmd/podman/system/connection/add.go
@@ -112,7 +112,7 @@ func add(cmd *cobra.Command, args []string) error {
iden = cOpts.Identity
}
if uri.Path == "" || uri.Path == "/" {
- if uri.Path, err = getUDS(cmd, uri, iden); err != nil {
+ if uri.Path, err = getUDS(uri, iden); err != nil {
return err
}
}
@@ -204,7 +204,7 @@ func GetUserInfo(uri *url.URL) (*url.Userinfo, error) {
return url.User(usr.Username), nil
}
-func getUDS(cmd *cobra.Command, uri *url.URL, iden string) (string, error) {
+func getUDS(uri *url.URL, iden string) (string, error) {
cfg, err := ValidateAndConfigure(uri, iden)
if err != nil {
return "", errors.Wrapf(err, "failed to validate")
diff --git a/libpod/container_api.go b/libpod/container_api.go
index ebefed600..fe41998c0 100644
--- a/libpod/container_api.go
+++ b/libpod/container_api.go
@@ -889,7 +889,7 @@ func (c *Container) CopyFromArchive(ctx context.Context, containerPath string, c
}
}
- return c.copyFromArchive(ctx, containerPath, chown, rename, tarStream)
+ return c.copyFromArchive(containerPath, chown, rename, tarStream)
}
// CopyToArchive copies the contents from the specified path *inside* the
@@ -904,7 +904,7 @@ func (c *Container) CopyToArchive(ctx context.Context, containerPath string, tar
}
}
- return c.copyToArchive(ctx, containerPath, tarStream)
+ return c.copyToArchive(containerPath, tarStream)
}
// Stat the specified path *inside* the container and return a file info.
@@ -934,6 +934,6 @@ func (c *Container) Stat(ctx context.Context, containerPath string) (*define.Fil
}()
}
- info, _, _, err := c.stat(ctx, mountPoint, containerPath)
+ info, _, _, err := c.stat(mountPoint, containerPath)
return info, err
}
diff --git a/libpod/container_copy_linux.go b/libpod/container_copy_linux.go
index 38927d691..91e712c74 100644
--- a/libpod/container_copy_linux.go
+++ b/libpod/container_copy_linux.go
@@ -4,7 +4,6 @@
package libpod
import (
- "context"
"io"
"os"
"path/filepath"
@@ -24,7 +23,7 @@ import (
"golang.org/x/sys/unix"
)
-func (c *Container) copyFromArchive(ctx context.Context, path string, chown bool, rename map[string]string, reader io.Reader) (func() error, error) {
+func (c *Container) copyFromArchive(path string, chown bool, rename map[string]string, reader io.Reader) (func() error, error) {
var (
mountPoint string
resolvedRoot string
@@ -93,7 +92,7 @@ func (c *Container) copyFromArchive(ctx context.Context, path string, chown bool
Rename: rename,
}
- return c.joinMountAndExec(ctx,
+ return c.joinMountAndExec(
func() error {
return buildahCopiah.Put(resolvedRoot, resolvedPath, putOptions, decompressed)
},
@@ -101,7 +100,7 @@ func (c *Container) copyFromArchive(ctx context.Context, path string, chown bool
}, nil
}
-func (c *Container) copyToArchive(ctx context.Context, path string, writer io.Writer) (func() error, error) {
+func (c *Container) copyToArchive(path string, writer io.Writer) (func() error, error) {
var (
mountPoint string
unmount func()
@@ -121,7 +120,7 @@ func (c *Container) copyToArchive(ctx context.Context, path string, writer io.Wr
unmount = func() { c.unmount(false) }
}
- statInfo, resolvedRoot, resolvedPath, err := c.stat(ctx, mountPoint, path)
+ statInfo, resolvedRoot, resolvedPath, err := c.stat(mountPoint, path)
if err != nil {
unmount()
return nil, err
@@ -165,7 +164,7 @@ func (c *Container) copyToArchive(ctx context.Context, path string, writer io.Wr
// container's user namespace.
IgnoreUnreadable: rootless.IsRootless() && c.state.State == define.ContainerStateRunning,
}
- return c.joinMountAndExec(ctx,
+ return c.joinMountAndExec(
func() error {
return buildahCopiah.Get(resolvedRoot, "", getOptions, []string{resolvedPath}, writer)
},
@@ -216,7 +215,7 @@ func idtoolsToRuntimeSpec(idMaps []idtools.IDMap) (convertedIDMap []specs.LinuxI
// container's file system.
//
// Note, if the container is not running `f()` will be executed as is.
-func (c *Container) joinMountAndExec(ctx context.Context, f func() error) error {
+func (c *Container) joinMountAndExec(f func() error) error {
if c.state.State != define.ContainerStateRunning {
return f()
}
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go
index 9d0c8ff8c..63ef26bfc 100644
--- a/libpod/container_internal_linux.go
+++ b/libpod/container_internal_linux.go
@@ -2632,7 +2632,7 @@ func (c *Container) generateGroupEntry() (string, error) {
addedGID = gid
}
if c.config.User != "" {
- entry, _, err := c.generateUserGroupEntry(addedGID)
+ entry, err := c.generateUserGroupEntry(addedGID)
if err != nil {
return "", err
}
@@ -2685,9 +2685,9 @@ func (c *Container) generateCurrentUserGroupEntry() (string, int, error) {
// Make an entry in /etc/group for the group the container was specified to run
// as.
-func (c *Container) generateUserGroupEntry(addedGID int) (string, int, error) {
+func (c *Container) generateUserGroupEntry(addedGID int) (string, error) {
if c.config.User == "" {
- return "", 0, nil
+ return "", nil
}
splitUser := strings.SplitN(c.config.User, ":", 2)
@@ -2698,20 +2698,20 @@ func (c *Container) generateUserGroupEntry(addedGID int) (string, int, error) {
gid, err := strconv.ParseUint(group, 10, 32)
if err != nil {
- return "", 0, nil // nolint: nilerr
+ return "", nil // nolint: nilerr
}
if addedGID != 0 && addedGID == int(gid) {
- return "", 0, nil
+ return "", nil
}
// Check if the group already exists
_, err = lookup.GetGroup(c.state.Mountpoint, group)
if err != runcuser.ErrNoGroupEntries {
- return "", 0, err
+ return "", err
}
- return fmt.Sprintf("%d:x:%d:%s\n", gid, gid, splitUser[0]), int(gid), nil
+ return fmt.Sprintf("%d:x:%d:%s\n", gid, gid, splitUser[0]), nil
}
// generatePasswdEntry generates an entry or entries into /etc/passwd as
@@ -2751,7 +2751,7 @@ func (c *Container) generatePasswdEntry() (string, error) {
addedUID = uid
}
if c.config.User != "" {
- entry, _, _, err := c.generateUserPasswdEntry(addedUID)
+ entry, err := c.generateUserPasswdEntry(addedUID)
if err != nil {
return "", err
}
@@ -2838,13 +2838,13 @@ func (c *Container) userPasswdEntry(u *user.User) (string, error) {
// Accepts one argument, that being any UID that has already been added to the
// passwd file by other functions; if it matches the UID we were given, we don't
// need to do anything.
-func (c *Container) generateUserPasswdEntry(addedUID int) (string, int, int, error) {
+func (c *Container) generateUserPasswdEntry(addedUID int) (string, error) {
var (
groupspec string
gid int
)
if c.config.User == "" {
- return "", 0, 0, nil
+ return "", nil
}
splitSpec := strings.SplitN(c.config.User, ":", 2)
userspec := splitSpec[0]
@@ -2854,17 +2854,17 @@ func (c *Container) generateUserPasswdEntry(addedUID int) (string, int, int, err
// If a non numeric User, then don't generate passwd
uid, err := strconv.ParseUint(userspec, 10, 32)
if err != nil {
- return "", 0, 0, nil // nolint: nilerr
+ return "", nil // nolint: nilerr
}
if addedUID != 0 && int(uid) == addedUID {
- return "", 0, 0, nil
+ return "", nil
}
// Lookup the user to see if it exists in the container image
_, err = lookup.GetUser(c.state.Mountpoint, userspec)
if err != runcuser.ErrNoPasswdEntries {
- return "", 0, 0, err
+ return "", err
}
if groupspec != "" {
@@ -2874,7 +2874,7 @@ func (c *Container) generateUserPasswdEntry(addedUID int) (string, int, int, err
} else {
group, err := lookup.GetGroup(c.state.Mountpoint, groupspec)
if err != nil {
- return "", 0, 0, errors.Wrapf(err, "unable to get gid %s from group file", groupspec)
+ return "", errors.Wrapf(err, "unable to get gid %s from group file", groupspec)
}
gid = group.Gid
}
@@ -2882,10 +2882,10 @@ func (c *Container) generateUserPasswdEntry(addedUID int) (string, int, int, err
if c.config.PasswdEntry != "" {
entry := c.passwdEntry(fmt.Sprintf("%d", uid), fmt.Sprintf("%d", uid), fmt.Sprintf("%d", gid), "container user", c.WorkingDir())
- return entry, int(uid), gid, nil
+ return entry, nil
}
- return fmt.Sprintf("%d:*:%d:%d:container user:%s:/bin/sh\n", uid, uid, gid, c.WorkingDir()), int(uid), gid, nil
+ return fmt.Sprintf("%d:*:%d:%d:container user:%s:/bin/sh\n", uid, uid, gid, c.WorkingDir()), nil
}
func (c *Container) passwdEntry(username string, uid, gid, name, homeDir string) string {
diff --git a/libpod/container_internal_linux_test.go b/libpod/container_internal_linux_test.go
index 2c1193445..03095aa58 100644
--- a/libpod/container_internal_linux_test.go
+++ b/libpod/container_internal_linux_test.go
@@ -30,14 +30,14 @@ func TestGenerateUserPasswdEntry(t *testing.T) {
Mountpoint: "/does/not/exist/tmp/",
},
}
- user, _, _, err := c.generateUserPasswdEntry(0)
+ user, err := c.generateUserPasswdEntry(0)
if err != nil {
t.Fatal(err)
}
assert.Equal(t, user, "123:*:123:456:container user:/:/bin/sh\n")
c.config.User = "567"
- user, _, _, err = c.generateUserPasswdEntry(0)
+ user, err = c.generateUserPasswdEntry(0)
if err != nil {
t.Fatal(err)
}
@@ -56,14 +56,14 @@ func TestGenerateUserGroupEntry(t *testing.T) {
Mountpoint: "/does/not/exist/tmp/",
},
}
- group, _, err := c.generateUserGroupEntry(0)
+ group, err := c.generateUserGroupEntry(0)
if err != nil {
t.Fatal(err)
}
assert.Equal(t, group, "456:x:456:123\n")
c.config.User = "567"
- group, _, err = c.generateUserGroupEntry(0)
+ group, err = c.generateUserGroupEntry(0)
if err != nil {
t.Fatal(err)
}
diff --git a/libpod/container_stat_linux.go b/libpod/container_stat_linux.go
index 84ab984e0..9e225de2e 100644
--- a/libpod/container_stat_linux.go
+++ b/libpod/container_stat_linux.go
@@ -4,7 +4,6 @@
package libpod
import (
- "context"
"os"
"path/filepath"
"strings"
@@ -18,12 +17,12 @@ import (
// statInsideMount stats the specified path *inside* the container's mount and PID
// namespace. It returns the file info along with the resolved root ("/") and
// the resolved path (relative to the root).
-func (c *Container) statInsideMount(ctx context.Context, containerPath string) (*copier.StatForItem, string, string, error) {
+func (c *Container) statInsideMount(containerPath string) (*copier.StatForItem, string, string, error) {
resolvedRoot := "/"
resolvedPath := c.pathAbs(containerPath)
var statInfo *copier.StatForItem
- err := c.joinMountAndExec(ctx,
+ err := c.joinMountAndExec(
func() error {
var statErr error
statInfo, statErr = secureStat(resolvedRoot, resolvedPath)
@@ -38,7 +37,7 @@ func (c *Container) statInsideMount(ctx context.Context, containerPath string) (
// along with the resolved root and the resolved path. Both paths are absolute
// to the host's root. Note that the paths may resolved outside the
// container's mount point (e.g., to a volume or bind mount).
-func (c *Container) statOnHost(ctx context.Context, mountPoint string, containerPath string) (*copier.StatForItem, string, string, error) {
+func (c *Container) statOnHost(mountPoint string, containerPath string) (*copier.StatForItem, string, string, error) {
// Now resolve the container's path. It may hit a volume, it may hit a
// bind mount, it may be relative.
resolvedRoot, resolvedPath, err := c.resolvePath(mountPoint, containerPath)
@@ -50,7 +49,7 @@ func (c *Container) statOnHost(ctx context.Context, mountPoint string, container
return statInfo, resolvedRoot, resolvedPath, err
}
-func (c *Container) stat(ctx context.Context, containerMountPoint string, containerPath string) (*define.FileInfo, string, string, error) {
+func (c *Container) stat(containerMountPoint string, containerPath string) (*define.FileInfo, string, string, error) {
var (
resolvedRoot string
resolvedPath string
@@ -75,11 +74,11 @@ func (c *Container) stat(ctx context.Context, containerMountPoint string, contai
if c.state.State == define.ContainerStateRunning {
// If the container is running, we need to join it's mount namespace
// and stat there.
- statInfo, resolvedRoot, resolvedPath, statErr = c.statInsideMount(ctx, containerPath)
+ statInfo, resolvedRoot, resolvedPath, statErr = c.statInsideMount(containerPath)
} else {
// If the container is NOT running, we need to resolve the path
// on the host.
- statInfo, resolvedRoot, resolvedPath, statErr = c.statOnHost(ctx, containerMountPoint, containerPath)
+ statInfo, resolvedRoot, resolvedPath, statErr = c.statOnHost(containerMountPoint, containerPath)
}
if statErr != nil {
diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go
index 41beaf41d..937dc4fae 100644
--- a/libpod/networking_linux.go
+++ b/libpod/networking_linux.go
@@ -74,7 +74,7 @@ func (c *Container) convertPortMappings() []types.PortMapping {
return newPorts
}
-func (c *Container) getNetworkOptions(networkOpts map[string]types.PerNetworkOptions) (types.NetworkOptions, error) {
+func (c *Container) getNetworkOptions(networkOpts map[string]types.PerNetworkOptions) types.NetworkOptions {
opts := types.NetworkOptions{
ContainerID: c.config.ID,
ContainerName: getCNIPodName(c),
@@ -88,7 +88,7 @@ func (c *Container) getNetworkOptions(networkOpts map[string]types.PerNetworkOpt
} else {
opts.Networks = networkOpts
}
- return opts, nil
+ return opts
}
type RootlessNetNS struct {
@@ -653,10 +653,7 @@ func (r *Runtime) configureNetNS(ctr *Container, ctrNS ns.NetNS) (status map[str
return nil, nil
}
- netOpts, err := ctr.getNetworkOptions(networks)
- if err != nil {
- return nil, err
- }
+ netOpts := ctr.getNetworkOptions(networks)
netStatus, err := r.setUpNetwork(ctrNS.Path(), netOpts)
if err != nil {
return nil, err
@@ -814,10 +811,7 @@ func (r *Runtime) teardownCNI(ctr *Container) error {
}
if !ctr.config.NetMode.IsSlirp4netns() && len(networks) > 0 {
- netOpts, err := ctr.getNetworkOptions(networks)
- if err != nil {
- return err
- }
+ netOpts := ctr.getNetworkOptions(networks)
return r.teardownNetwork(ctr.state.NetNS.Path(), netOpts)
}
return nil
@@ -1000,11 +994,9 @@ func (c *Container) getContainerNetworkInfo() (*define.InspectNetworkSettings, e
if c.state.NetNS == nil {
if networkNSPath := c.joinedNetworkNSPath(); networkNSPath != "" {
if result, err := c.inspectJoinedNetworkNS(networkNSPath); err == nil {
- if basicConfig, err := resultToBasicNetworkConfig(result); err == nil {
- // fallback to dummy configuration
- settings.InspectBasicNetworkConfig = basicConfig
- return settings, nil
- }
+ // fallback to dummy configuration
+ settings.InspectBasicNetworkConfig = resultToBasicNetworkConfig(result)
+ return settings, nil
}
// do not propagate error inspecting a joined network ns
logrus.Errorf("Inspecting network namespace: %s of container %s: %v", networkNSPath, c.ID(), err)
@@ -1047,14 +1039,8 @@ func (c *Container) getContainerNetworkInfo() (*define.InspectNetworkSettings, e
result := netStatus[name]
addedNet := new(define.InspectAdditionalNetwork)
addedNet.NetworkID = name
-
- basicConfig, err := resultToBasicNetworkConfig(result)
- if err != nil {
- return nil, err
- }
addedNet.Aliases = opts.Aliases
-
- addedNet.InspectBasicNetworkConfig = basicConfig
+ addedNet.InspectBasicNetworkConfig = resultToBasicNetworkConfig(result)
settings.Networks[name] = addedNet
}
@@ -1074,11 +1060,7 @@ func (c *Container) getContainerNetworkInfo() (*define.InspectNetworkSettings, e
if len(netStatus) == 1 {
for _, status := range netStatus {
- basicConfig, err := resultToBasicNetworkConfig(status)
- if err != nil {
- return nil, err
- }
- settings.InspectBasicNetworkConfig = basicConfig
+ settings.InspectBasicNetworkConfig = resultToBasicNetworkConfig(status)
}
}
return settings, nil
@@ -1152,7 +1134,7 @@ func (c *Container) inspectJoinedNetworkNS(networkns string) (q types.StatusBloc
// resultToBasicNetworkConfig produces an InspectBasicNetworkConfig from a CNI
// result
-func resultToBasicNetworkConfig(result types.StatusBlock) (define.InspectBasicNetworkConfig, error) {
+func resultToBasicNetworkConfig(result types.StatusBlock) define.InspectBasicNetworkConfig {
config := define.InspectBasicNetworkConfig{}
interfaceNames := make([]string, 0, len(result.Interfaces))
for interfaceName := range result.Interfaces {
@@ -1190,7 +1172,7 @@ func resultToBasicNetworkConfig(result types.StatusBlock) (define.InspectBasicNe
config.AdditionalMacAddresses = append(config.AdditionalMacAddresses, netInt.MacAddress.String())
}
}
- return config, nil
+ return config
}
type logrusDebugWriter struct {
diff --git a/libpod/networking_linux_test.go b/libpod/networking_linux_test.go
index a21494824..2aeb1a02c 100644
--- a/libpod/networking_linux_test.go
+++ b/libpod/networking_linux_test.go
@@ -241,7 +241,6 @@ func Test_ocicniPortsToNetTypesPorts(t *testing.T) {
func Test_resultToBasicNetworkConfig(t *testing.T) {
testCases := []struct {
description string
- expectError bool
inputResult types.StatusBlock
expectedNetworkConfig define.InspectBasicNetworkConfig
}{
@@ -431,15 +430,7 @@ func Test_resultToBasicNetworkConfig(t *testing.T) {
tc := tcl
t.Run(tc.description, func(t *testing.T) {
t.Parallel()
- actualNetworkConfig, err := resultToBasicNetworkConfig(tc.inputResult)
-
- if tc.expectError && err == nil {
- t.Fatalf("Expected error didn't happen")
- }
-
- if !tc.expectError && err != nil {
- t.Fatalf("Unexpected error happened: %v", err)
- }
+ actualNetworkConfig := resultToBasicNetworkConfig(tc.inputResult)
if !reflect.DeepEqual(tc.expectedNetworkConfig, actualNetworkConfig) {
t.Fatalf(
diff --git a/libpod/oci_conmon_exec_linux.go b/libpod/oci_conmon_exec_linux.go
index 1005d18da..b8fd82591 100644
--- a/libpod/oci_conmon_exec_linux.go
+++ b/libpod/oci_conmon_exec_linux.go
@@ -439,7 +439,7 @@ func (r *ConmonOCIRuntime) startExec(c *Container, sessionID string, options *Ex
// }
// }
- conmonEnv := r.configureConmonEnv(c, runtimeDir)
+ conmonEnv := r.configureConmonEnv(runtimeDir)
var filesToClose []*os.File
if options.PreserveFDs > 0 {
diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go
index 06ba8a03f..dc1c75cea 100644
--- a/libpod/oci_conmon_linux.go
+++ b/libpod/oci_conmon_linux.go
@@ -1181,7 +1181,7 @@ func (r *ConmonOCIRuntime) createOCIContainer(ctr *Container, restoreOptions *Co
}
// 0, 1 and 2 are stdin, stdout and stderr
- conmonEnv := r.configureConmonEnv(ctr, runtimeDir)
+ conmonEnv := r.configureConmonEnv(runtimeDir)
var filesToClose []*os.File
if preserveFDs > 0 {
@@ -1312,7 +1312,7 @@ func (r *ConmonOCIRuntime) createOCIContainer(ctr *Container, restoreOptions *Co
// configureConmonEnv gets the environment values to add to conmon's exec struct
// TODO this may want to be less hardcoded/more configurable in the future
-func (r *ConmonOCIRuntime) configureConmonEnv(ctr *Container, runtimeDir string) []string {
+func (r *ConmonOCIRuntime) configureConmonEnv(runtimeDir string) []string {
var env []string
for _, e := range os.Environ() {
if strings.HasPrefix(e, "LC_") {
diff --git a/libpod/runtime.go b/libpod/runtime.go
index 07653217a..877e151a9 100644
--- a/libpod/runtime.go
+++ b/libpod/runtime.go
@@ -167,7 +167,7 @@ func NewRuntime(ctx context.Context, options ...RuntimeOption) (*Runtime, error)
if err != nil {
return nil, err
}
- return newRuntimeFromConfig(ctx, conf, options...)
+ return newRuntimeFromConfig(conf, options...)
}
// NewRuntimeFromConfig creates a new container runtime using the given
@@ -176,10 +176,10 @@ func NewRuntime(ctx context.Context, options ...RuntimeOption) (*Runtime, error)
// An error will be returned if the configuration file at the given path does
// not exist or cannot be loaded
func NewRuntimeFromConfig(ctx context.Context, userConfig *config.Config, options ...RuntimeOption) (*Runtime, error) {
- return newRuntimeFromConfig(ctx, userConfig, options...)
+ return newRuntimeFromConfig(userConfig, options...)
}
-func newRuntimeFromConfig(ctx context.Context, conf *config.Config, options ...RuntimeOption) (*Runtime, error) {
+func newRuntimeFromConfig(conf *config.Config, options ...RuntimeOption) (*Runtime, error) {
runtime := new(Runtime)
if conf.Engine.OCIRuntime == "" {
@@ -224,7 +224,7 @@ func newRuntimeFromConfig(ctx context.Context, conf *config.Config, options ...R
return nil, errors.Wrapf(err, "error starting shutdown signal handler")
}
- if err := makeRuntime(ctx, runtime); err != nil {
+ if err := makeRuntime(runtime); err != nil {
return nil, err
}
@@ -292,7 +292,7 @@ func getLockManager(runtime *Runtime) (lock.Manager, error) {
// Make a new runtime based on the given configuration
// Sets up containers/storage, state store, OCI runtime
-func makeRuntime(ctx context.Context, runtime *Runtime) (retErr error) {
+func makeRuntime(runtime *Runtime) (retErr error) {
// Find a working conmon binary
cPath, err := findConmon(runtime.config.Engine.ConmonPath)
if err != nil {
@@ -598,7 +598,7 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (retErr error) {
runtime.valid = true
if runtime.doMigrate {
- if err := runtime.migrate(ctx); err != nil {
+ if err := runtime.migrate(); err != nil {
return err
}
}
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go
index a62c2b607..fd3ffd199 100644
--- a/libpod/runtime_ctr.go
+++ b/libpod/runtime_ctr.go
@@ -501,7 +501,7 @@ func (r *Runtime) setupContainer(ctx context.Context, ctr *Container) (_ *Contai
volOptions = append(volOptions, parsedOptions...)
}
}
- newVol, err := r.newVolume(ctx, volOptions...)
+ newVol, err := r.newVolume(volOptions...)
if err != nil {
return nil, errors.Wrapf(err, "error creating named volume %q", vol.Name)
}
diff --git a/libpod/runtime_migrate.go b/libpod/runtime_migrate.go
index fccd5bdee..f56cb83a4 100644
--- a/libpod/runtime_migrate.go
+++ b/libpod/runtime_migrate.go
@@ -4,7 +4,6 @@
package libpod
import (
- "context"
"fmt"
"io/ioutil"
"os"
@@ -46,7 +45,7 @@ func (r *Runtime) stopPauseProcess() error {
return nil
}
-func (r *Runtime) migrate(ctx context.Context) error {
+func (r *Runtime) migrate() error {
runningContainers, err := r.GetRunningContainers()
if err != nil {
return err
diff --git a/libpod/runtime_volume_linux.go b/libpod/runtime_volume_linux.go
index 3d585fa7a..241f6e2f2 100644
--- a/libpod/runtime_volume_linux.go
+++ b/libpod/runtime_volume_linux.go
@@ -25,11 +25,11 @@ func (r *Runtime) NewVolume(ctx context.Context, options ...VolumeCreateOption)
if !r.valid {
return nil, define.ErrRuntimeStopped
}
- return r.newVolume(ctx, options...)
+ return r.newVolume(options...)
}
// newVolume creates a new empty volume
-func (r *Runtime) newVolume(ctx context.Context, options ...VolumeCreateOption) (_ *Volume, deferredErr error) {
+func (r *Runtime) newVolume(options ...VolumeCreateOption) (_ *Volume, deferredErr error) {
volume := newVolume(r)
for _, option := range options {
if err := option(volume); err != nil {
diff --git a/pkg/autoupdate/autoupdate.go b/pkg/autoupdate/autoupdate.go
index 07962a965..ee530528e 100644
--- a/pkg/autoupdate/autoupdate.go
+++ b/pkg/autoupdate/autoupdate.go
@@ -209,7 +209,7 @@ func autoUpdateRegistry(ctx context.Context, image *libimage.Image, ctr *libpod.
}
authfile := getAuthfilePath(ctr, options)
- needsUpdate, err := newerRemoteImageAvailable(ctx, runtime, image, rawImageName, authfile)
+ needsUpdate, err := newerRemoteImageAvailable(ctx, image, rawImageName, authfile)
if err != nil {
return report, errors.Wrapf(err, "registry auto-updating container %q: image check for %q failed", cid, rawImageName)
}
@@ -399,7 +399,7 @@ func getAuthfilePath(ctr *libpod.Container, options *entities.AutoUpdateOptions)
// newerRemoteImageAvailable returns true if there corresponding image on the remote
// registry is newer.
-func newerRemoteImageAvailable(ctx context.Context, runtime *libpod.Runtime, img *libimage.Image, origName string, authfile string) (bool, error) {
+func newerRemoteImageAvailable(ctx context.Context, img *libimage.Image, origName string, authfile string) (bool, error) {
remoteRef, err := docker.ParseReference("//" + origName)
if err != nil {
return false, err
diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go
index c3f6bb17d..1d347ed8c 100644
--- a/pkg/domain/infra/abi/play.go
+++ b/pkg/domain/infra/abi/play.go
@@ -114,7 +114,7 @@ func (ic *ContainerEngine) PlayKube(ctx context.Context, body io.Reader, options
return nil, errors.Wrap(err, "unable to read YAML as Kube PersistentVolumeClaim")
}
- r, err := ic.playKubePVC(ctx, &pvcYAML, options)
+ r, err := ic.playKubePVC(ctx, &pvcYAML)
if err != nil {
return nil, err
}
@@ -592,7 +592,7 @@ func (ic *ContainerEngine) getImageAndLabelInfo(ctx context.Context, cwd string,
}
// playKubePVC creates a podman volume from a kube persistent volume claim.
-func (ic *ContainerEngine) playKubePVC(ctx context.Context, pvcYAML *v1.PersistentVolumeClaim, options entities.PlayKubeOptions) (*entities.PlayKubeReport, error) {
+func (ic *ContainerEngine) playKubePVC(ctx context.Context, pvcYAML *v1.PersistentVolumeClaim) (*entities.PlayKubeReport, error) {
var report entities.PlayKubeReport
opts := make(map[string]string)
diff --git a/pkg/machine/fcos.go b/pkg/machine/fcos.go
index ad1be15c7..88e35dd04 100644
--- a/pkg/machine/fcos.go
+++ b/pkg/machine/fcos.go
@@ -139,7 +139,7 @@ func getStreamURL(streamType string) url2.URL {
// This should get Exported and stay put as it will apply to all fcos downloads
// getFCOS parses fedoraCoreOS's stream and returns the image download URL and the release version
-func getFCOSDownload(imageStream string) (*fcosDownloadInfo, error) { // nolint:staticcheck
+func getFCOSDownload(imageStream string) (*fcosDownloadInfo, error) { // nolint:staticcheck,unparam
var (
fcosstable stream.Stream
altMeta release.Release
diff --git a/pkg/specgen/generate/container_create.go b/pkg/specgen/generate/container_create.go
index 021b88280..50454cbab 100644
--- a/pkg/specgen/generate/container_create.go
+++ b/pkg/specgen/generate/container_create.go
@@ -146,13 +146,13 @@ func MakeContainer(ctx context.Context, rt *libpod.Runtime, s *specgen.SpecGener
options = append(options, libpod.WithHostUsers(s.HostUsers))
}
- command, err := makeCommand(ctx, s, imageData, rtc)
+ command, err := makeCommand(s, imageData, rtc)
if err != nil {
return nil, nil, nil, err
}
infraVol := (len(compatibleOptions.Mounts) > 0 || len(compatibleOptions.Volumes) > 0 || len(compatibleOptions.ImageVolumes) > 0 || len(compatibleOptions.OverlayVolumes) > 0)
- opts, err := createContainerOptions(ctx, rt, s, pod, finalVolumes, finalOverlays, imageData, command, infraVol, *compatibleOptions)
+ opts, err := createContainerOptions(rt, s, pod, finalVolumes, finalOverlays, imageData, command, infraVol, *compatibleOptions)
if err != nil {
return nil, nil, nil, err
}
@@ -251,7 +251,7 @@ func isCDIDevice(device string) bool {
return cdi.IsQualifiedName(device)
}
-func createContainerOptions(ctx context.Context, rt *libpod.Runtime, s *specgen.SpecGenerator, pod *libpod.Pod, volumes []*specgen.NamedVolume, overlays []*specgen.OverlayVolume, imageData *libimage.ImageData, command []string, infraVolumes bool, compatibleOptions libpod.InfraInherit) ([]libpod.CtrCreateOption, error) {
+func createContainerOptions(rt *libpod.Runtime, s *specgen.SpecGenerator, pod *libpod.Pod, volumes []*specgen.NamedVolume, overlays []*specgen.OverlayVolume, imageData *libimage.ImageData, command []string, infraVolumes bool, compatibleOptions libpod.InfraInherit) ([]libpod.CtrCreateOption, error) {
var options []libpod.CtrCreateOption
var err error
@@ -453,7 +453,7 @@ func createContainerOptions(ctx context.Context, rt *libpod.Runtime, s *specgen.
options = append(options, libpod.WithPrivileged(s.Privileged))
// Get namespace related options
- namespaceOpts, err := namespaceOptions(ctx, s, rt, pod, imageData)
+ namespaceOpts, err := namespaceOptions(s, rt, pod, imageData)
if err != nil {
return nil, err
}
diff --git a/pkg/specgen/generate/namespaces.go b/pkg/specgen/generate/namespaces.go
index d8d1ae652..2362f61c4 100644
--- a/pkg/specgen/generate/namespaces.go
+++ b/pkg/specgen/generate/namespaces.go
@@ -1,7 +1,6 @@
package generate
import (
- "context"
"fmt"
"os"
"strings"
@@ -80,7 +79,7 @@ func GetDefaultNamespaceMode(nsType string, cfg *config.Config, pod *libpod.Pod)
// joining a pod.
// TODO: Consider grouping options that are not directly attached to a namespace
// elsewhere.
-func namespaceOptions(ctx context.Context, s *specgen.SpecGenerator, rt *libpod.Runtime, pod *libpod.Pod, imageData *libimage.ImageData) ([]libpod.CtrCreateOption, error) {
+func namespaceOptions(s *specgen.SpecGenerator, rt *libpod.Runtime, pod *libpod.Pod, imageData *libimage.ImageData) ([]libpod.CtrCreateOption, error) {
toReturn := []libpod.CtrCreateOption{}
// If pod is not nil, get infra container.
@@ -256,7 +255,7 @@ func namespaceOptions(ctx context.Context, s *specgen.SpecGenerator, rt *libpod.
}
toReturn = append(toReturn, libpod.WithNetNSFrom(netCtr))
case specgen.Slirp:
- portMappings, expose, err := createPortMappings(ctx, s, imageData)
+ portMappings, expose, err := createPortMappings(s, imageData)
if err != nil {
return nil, err
}
@@ -268,7 +267,7 @@ func namespaceOptions(ctx context.Context, s *specgen.SpecGenerator, rt *libpod.
case specgen.Private:
fallthrough
case specgen.Bridge:
- portMappings, expose, err := createPortMappings(ctx, s, imageData)
+ portMappings, expose, err := createPortMappings(s, imageData)
if err != nil {
return nil, err
}
diff --git a/pkg/specgen/generate/oci.go b/pkg/specgen/generate/oci.go
index 961cea933..95bcea8f0 100644
--- a/pkg/specgen/generate/oci.go
+++ b/pkg/specgen/generate/oci.go
@@ -32,7 +32,7 @@ func setProcOpts(s *specgen.SpecGenerator, g *generate.Generator) {
}
}
-func addRlimits(s *specgen.SpecGenerator, g *generate.Generator) error {
+func addRlimits(s *specgen.SpecGenerator, g *generate.Generator) {
var (
isRootless = rootless.IsRootless()
nofileSet = false
@@ -41,7 +41,7 @@ func addRlimits(s *specgen.SpecGenerator, g *generate.Generator) error {
if s.Rlimits == nil {
g.Config.Process.Rlimits = nil
- return nil
+ return
}
for _, u := range s.Rlimits {
@@ -91,12 +91,10 @@ func addRlimits(s *specgen.SpecGenerator, g *generate.Generator) error {
}
g.AddProcessRlimits("RLIMIT_NPROC", max, current)
}
-
- return nil
}
// Produce the final command for the container.
-func makeCommand(ctx context.Context, s *specgen.SpecGenerator, imageData *libimage.ImageData, rtc *config.Config) ([]string, error) {
+func makeCommand(s *specgen.SpecGenerator, imageData *libimage.ImageData, rtc *config.Config) ([]string, error) {
finalCommand := []string{}
entrypoint := s.Entrypoint
@@ -388,9 +386,7 @@ func SpecGenToOCI(ctx context.Context, s *specgen.SpecGenerator, rt *libpod.Runt
g.AddProcessEnv(name, val)
}
- if err := addRlimits(s, &g); err != nil {
- return nil, err
- }
+ addRlimits(s, &g)
// NAMESPACES
if err := specConfigureNamespaces(s, &g, rt, pod); err != nil {
diff --git a/pkg/specgen/generate/pod_create.go b/pkg/specgen/generate/pod_create.go
index ba823f3a8..a3408b402 100644
--- a/pkg/specgen/generate/pod_create.go
+++ b/pkg/specgen/generate/pod_create.go
@@ -119,7 +119,7 @@ func MakePod(p *entities.PodSpec, rt *libpod.Runtime) (*libpod.Pod, error) {
}
}
- options, err := createPodOptions(&p.PodSpecGen, rt, p.PodSpecGen.InfraContainerSpec)
+ options, err := createPodOptions(&p.PodSpecGen)
if err != nil {
return nil, err
}
@@ -161,11 +161,11 @@ func MakePod(p *entities.PodSpec, rt *libpod.Runtime) (*libpod.Pod, error) {
return pod, nil
}
-func createPodOptions(p *specgen.PodSpecGenerator, rt *libpod.Runtime, infraSpec *specgen.SpecGenerator) ([]libpod.PodCreateOption, error) {
+func createPodOptions(p *specgen.PodSpecGenerator) ([]libpod.PodCreateOption, error) {
var (
options []libpod.PodCreateOption
)
- if !p.NoInfra { //&& infraSpec != nil {
+ if !p.NoInfra {
options = append(options, libpod.WithInfraContainer())
if p.ShareParent == nil || (p.ShareParent != nil && *p.ShareParent) {
options = append(options, libpod.WithPodParent())
diff --git a/pkg/specgen/generate/ports.go b/pkg/specgen/generate/ports.go
index c30c4e49d..bec548d3b 100644
--- a/pkg/specgen/generate/ports.go
+++ b/pkg/specgen/generate/ports.go
@@ -1,7 +1,6 @@
package generate
import (
- "context"
"fmt"
"net"
"sort"
@@ -338,7 +337,7 @@ func appendProtocolsNoDuplicates(slice []string, protocols []string) []string {
}
// Make final port mappings for the container
-func createPortMappings(ctx context.Context, s *specgen.SpecGenerator, imageData *libimage.ImageData) ([]types.PortMapping, map[uint16][]string, error) {
+func createPortMappings(s *specgen.SpecGenerator, imageData *libimage.ImageData) ([]types.PortMapping, map[uint16][]string, error) {
expose := make(map[uint16]string)
var err error
if imageData != nil {
diff --git a/pkg/specgenutil/specgen.go b/pkg/specgenutil/specgen.go
index 00de99817..f0dfcac1a 100644
--- a/pkg/specgenutil/specgen.go
+++ b/pkg/specgenutil/specgen.go
@@ -136,7 +136,7 @@ func LimitToSwap(memory *specs.LinuxMemory, swap string, ml int64) {
}
}
-func getMemoryLimits(s *specgen.SpecGenerator, c *entities.ContainerCreateOptions) (*specs.LinuxMemory, error) {
+func getMemoryLimits(c *entities.ContainerCreateOptions) (*specs.LinuxMemory, error) {
var err error
memory := &specs.LinuxMemory{}
hasLimits := false
@@ -497,7 +497,7 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *entities.ContainerCreateOptions
}
if s.ResourceLimits.Memory == nil || (len(c.Memory) != 0 || len(c.MemoryReservation) != 0 || len(c.MemorySwap) != 0 || c.MemorySwappiness != 0) {
- s.ResourceLimits.Memory, err = getMemoryLimits(s, c)
+ s.ResourceLimits.Memory, err = getMemoryLimits(c)
if err != nil {
return err
}
diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go
index f808eb2b6..c5cdd2c1d 100644
--- a/test/e2e/common_test.go
+++ b/test/e2e/common_test.go
@@ -1047,7 +1047,7 @@ var IPRegex = `(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01
// digShort execs into the given container and does a dig lookup with a timeout
// backoff. If it gets a response, it ensures that the output is in the correct
// format and iterates a string array for match
-func digShort(container, lookupName string, matchNames []string, p *PodmanTestIntegration) string {
+func digShort(container, lookupName string, matchNames []string, p *PodmanTestIntegration) {
digInterval := time.Millisecond * 250
for i := 0; i < 6; i++ {
time.Sleep(digInterval * time.Duration(i))
@@ -1059,9 +1059,9 @@ func digShort(container, lookupName string, matchNames []string, p *PodmanTestIn
for _, name := range matchNames {
Expect(output).To(Equal(name))
}
- return output
+ // success
+ return
}
}
Fail("dns is not responding")
- return ""
}
diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go
index f16180854..4dd05c755 100644
--- a/test/e2e/play_kube_test.go
+++ b/test/e2e/play_kube_test.go
@@ -680,7 +680,7 @@ func generateMultiDocKubeYaml(kubeObjects []string, pathname string) error {
return writeYaml(multiKube, pathname)
}
-func createSecret(podmanTest *PodmanTestIntegration, name string, value []byte) {
+func createSecret(podmanTest *PodmanTestIntegration, name string, value []byte) { //nolint:unparam
secretFilePath := filepath.Join(podmanTest.TempDir, "secret")
err := ioutil.WriteFile(secretFilePath, value, 0755)
Expect(err).To(BeNil())
@@ -1078,7 +1078,7 @@ func withVolumeMount(mountPath string, readonly bool) ctrOption {
}
}
-func withEnv(name, value, valueFrom, refName, refKey string, optional bool) ctrOption {
+func withEnv(name, value, valueFrom, refName, refKey string, optional bool) ctrOption { //nolint:unparam
return func(c *Ctr) {
e := Env{
Name: name,
diff --git a/test/e2e/run_aardvark_test.go b/test/e2e/run_aardvark_test.go
index c82f614a6..7b4598423 100644
--- a/test/e2e/run_aardvark_test.go
+++ b/test/e2e/run_aardvark_test.go
@@ -54,7 +54,7 @@ var _ = Describe("Podman run networking", func() {
cip := ctrIP.OutputToString()
Expect(cip).To(MatchRegexp(IPRegex))
- _ = digShort(cid, "aone", []string{cip}, podmanTest)
+ digShort(cid, "aone", []string{cip}, podmanTest)
reverseLookup := podmanTest.Podman([]string{"exec", cid, "dig", "+short", "-x", cip})
reverseLookup.WaitWithDefaultTimeout()
@@ -95,9 +95,9 @@ var _ = Describe("Podman run networking", func() {
cip2 := ctrIP2.OutputToString()
Expect(cip2).To(MatchRegexp(IPRegex))
- _ = digShort("aone", "atwo", []string{cip2}, podmanTest)
+ digShort("aone", "atwo", []string{cip2}, podmanTest)
- _ = digShort("atwo", "aone", []string{cip1}, podmanTest)
+ digShort("atwo", "aone", []string{cip1}, podmanTest)
reverseLookup12 := podmanTest.Podman([]string{"exec", cid1, "dig", "+short", "-x", cip2})
reverseLookup12.WaitWithDefaultTimeout()
@@ -144,17 +144,17 @@ var _ = Describe("Podman run networking", func() {
cip2 := ctrIP2.OutputToString()
Expect(cip2).To(MatchRegexp(IPRegex))
- _ = digShort("aone", "atwo", []string{cip2}, podmanTest)
+ digShort("aone", "atwo", []string{cip2}, podmanTest)
- _ = digShort("aone", "alias_a2", []string{cip2}, podmanTest)
+ digShort("aone", "alias_a2", []string{cip2}, podmanTest)
- _ = digShort("aone", "alias_2a", []string{cip2}, podmanTest)
+ digShort("aone", "alias_2a", []string{cip2}, podmanTest)
- _ = digShort("atwo", "aone", []string{cip1}, podmanTest)
+ digShort("atwo", "aone", []string{cip1}, podmanTest)
- _ = digShort("atwo", "alias_a1", []string{cip1}, podmanTest)
+ digShort("atwo", "alias_a1", []string{cip1}, podmanTest)
- _ = digShort("atwo", "alias_1a", []string{cip1}, podmanTest)
+ digShort("atwo", "alias_1a", []string{cip1}, podmanTest)
})
@@ -251,13 +251,13 @@ var _ = Describe("Podman run networking", func() {
cipA2B22 := ctrIPA2B22.OutputToString()
Expect(cipA2B22).To(MatchRegexp(IPRegex))
- _ = digShort("aone", "atwobtwo", []string{cipA2B21}, podmanTest)
+ digShort("aone", "atwobtwo", []string{cipA2B21}, podmanTest)
- _ = digShort("bone", "atwobtwo", []string{cipA2B22}, podmanTest)
+ digShort("bone", "atwobtwo", []string{cipA2B22}, podmanTest)
- _ = digShort("atwobtwo", "aone", []string{cipA1}, podmanTest)
+ digShort("atwobtwo", "aone", []string{cipA1}, podmanTest)
- _ = digShort("atwobtwo", "bone", []string{cipB1}, podmanTest)
+ digShort("atwobtwo", "bone", []string{cipB1}, podmanTest)
})
It("Aardvark Test 6: Three subnets, first container on 1/2 and second on 2/3, w/ network aliases", func() {
@@ -305,9 +305,9 @@ var _ = Describe("Podman run networking", func() {
Expect(ctrIPCB2).Should(Exit(0))
cipCB2 := ctrIPCB2.OutputToString()
- _ = digShort("aone", "testB2_nw", []string{cipCB2}, podmanTest)
+ digShort("aone", "testB2_nw", []string{cipCB2}, podmanTest)
- _ = digShort("cone", "testB1_nw", []string{cipAB1}, podmanTest)
+ digShort("cone", "testB1_nw", []string{cipAB1}, podmanTest)
})
diff --git a/test/testvol/main.go b/test/testvol/main.go
index d15bf00cd..00b462eb2 100644
--- a/test/testvol/main.go
+++ b/test/testvol/main.go
@@ -86,10 +86,7 @@ func startServer(socketPath string) error {
}
}
- handle, err := makeDirDriver(config.path)
- if err != nil {
- return errors.Wrapf(err, "error making volume driver")
- }
+ handle := makeDirDriver(config.path)
logrus.Infof("Using %s for volume path", config.path)
server := volume.NewHandler(handle)
@@ -116,12 +113,12 @@ type dirVol struct {
}
// Make a new DirDriver.
-func makeDirDriver(path string) (volume.Driver, error) {
+func makeDirDriver(path string) volume.Driver {
drv := new(DirDriver)
drv.volumesPath = path
drv.volumes = make(map[string]*dirVol)
- return drv, nil
+ return drv
}
// Capabilities returns the capabilities of the driver.