summaryrefslogtreecommitdiff
path: root/pkg/specgen/namespaces.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-05-23 12:16:49 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2022-05-23 12:16:54 -0400
commit5d37d80ff9783b2c811a06d80cd06fd6e338faf0 (patch)
tree3efc472f3dde96ce2ce43992bc45fa31d9f805cf /pkg/specgen/namespaces.go
parent7d00b0ea0d0c53ddba8d6aebdbce2f167aceccc5 (diff)
downloadpodman-5d37d80ff9783b2c811a06d80cd06fd6e338faf0.tar.gz
podman-5d37d80ff9783b2c811a06d80cd06fd6e338faf0.tar.bz2
podman-5d37d80ff9783b2c811a06d80cd06fd6e338faf0.zip
Use containers/common/pkg/util.StringToSlice
[NO NEW TESTS NEEDED] Just code cleanup for better reuse Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/specgen/namespaces.go')
-rw-r--r--pkg/specgen/namespaces.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/specgen/namespaces.go b/pkg/specgen/namespaces.go
index 7a7ca2706..5a3b94ca4 100644
--- a/pkg/specgen/namespaces.go
+++ b/pkg/specgen/namespaces.go
@@ -8,6 +8,7 @@ import (
"github.com/containers/common/libnetwork/types"
"github.com/containers/common/pkg/cgroups"
+ cutil "github.com/containers/common/pkg/util"
"github.com/containers/podman/v4/libpod/define"
"github.com/containers/podman/v4/pkg/rootless"
"github.com/containers/podman/v4/pkg/util"
@@ -472,7 +473,7 @@ func ParseNetworkFlag(networks []string) (Namespace, map[string]types.PerNetwork
if parts[0] == "" {
return toReturn, nil, nil, errors.Wrapf(define.ErrInvalidArg, "network name cannot be empty")
}
- if util.StringInSlice(parts[0], []string{string(Bridge), string(Slirp), string(FromPod), string(NoNetwork),
+ if cutil.StringInSlice(parts[0], []string{string(Bridge), string(Slirp), string(FromPod), string(NoNetwork),
string(Default), string(Private), string(Path), string(FromContainer), string(Host)}) {
return toReturn, nil, nil, errors.Wrapf(define.ErrInvalidArg, "can only set extra network names, selected mode %s conflicts with bridge", parts[0])
}