mirror of
https://github.com/containers/podman.git
synced 2025-09-26 16:25:00 +08:00

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>
25 lines
512 B
Go
25 lines
512 B
Go
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
|
|
}
|