aboutsummaryrefslogtreecommitdiff
path: root/pkg/util
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-05-23 12:16:49 -0400
committerMatthew Heon <mheon@redhat.com>2022-06-14 14:25:33 -0400
commita71d8c9c8e6136b67925c618c9feeb2e7dc6d593 (patch)
treeab3d3915ff5067126a6cb21ad1368d1d76332c31 /pkg/util
parentc7276525b2f8929a1a54635d15abbfe52cd77ad5 (diff)
downloadpodman-a71d8c9c8e6136b67925c618c9feeb2e7dc6d593.tar.gz
podman-a71d8c9c8e6136b67925c618c9feeb2e7dc6d593.tar.bz2
podman-a71d8c9c8e6136b67925c618c9feeb2e7dc6d593.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/util')
-rw-r--r--pkg/util/utils.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/pkg/util/utils.go b/pkg/util/utils.go
index a0bf8b50d..1b7663330 100644
--- a/pkg/util/utils.go
+++ b/pkg/util/utils.go
@@ -17,6 +17,7 @@ import (
"github.com/BurntSushi/toml"
"github.com/containers/common/pkg/config"
+ "github.com/containers/common/pkg/util"
"github.com/containers/image/v5/types"
"github.com/containers/podman/v4/pkg/errorhandling"
"github.com/containers/podman/v4/pkg/namespaces"
@@ -78,14 +79,9 @@ func ParseRegistryCreds(creds string) (*types.DockerAuthConfig, error) {
}, nil
}
-// StringInSlice determines if a string is in a string slice, returns bool
+// StringInSlice is depracated, use containers/common/pkg/util/StringInSlice
func StringInSlice(s string, sl []string) bool {
- for _, i := range sl {
- if i == s {
- return true
- }
- }
- return false
+ return util.StringInSlice(s, sl)
}
// StringMatchRegexSlice determines if a given string matches one of the given regexes, returns bool