mirror of
https://github.com/containers/podman.git
synced 2025-09-28 01:04:28 +08:00
vendor c/common
Also update the e2e pull test to account for the changes when pulling from the dir transport. Images pulled via the dir transport are not tagged anymore; the path is not a reliable source. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
24
vendor/github.com/containers/common/pkg/util/util.go
generated
vendored
Normal file
24
vendor/github.com/containers/common/pkg/util/util.go
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
package util
|
||||
|
||||
import "regexp"
|
||||
|
||||
// StringInSlice determines if a string is in a string slice, returns bool
|
||||
func StringInSlice(s string, sl []string) bool {
|
||||
for _, i := range sl {
|
||||
if i == s {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// StringMatchRegexSlice determines if a given string matches one of the given regexes, returns bool
|
||||
func StringMatchRegexSlice(s string, re []string) bool {
|
||||
for _, r := range re {
|
||||
m, err := regexp.MatchString(r, s)
|
||||
if err == nil && m {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
Reference in New Issue
Block a user