mirror of
https://github.com/containers/podman.git
synced 2025-08-05 19:02:37 +08:00
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>
This commit is contained in:
@ -36,6 +36,7 @@ import (
|
||||
"github.com/containers/common/pkg/config"
|
||||
"github.com/containers/common/pkg/subscriptions"
|
||||
"github.com/containers/common/pkg/umask"
|
||||
cutil "github.com/containers/common/pkg/util"
|
||||
is "github.com/containers/image/v5/storage"
|
||||
"github.com/containers/podman/v4/libpod/define"
|
||||
"github.com/containers/podman/v4/libpod/events"
|
||||
@ -393,7 +394,7 @@ func (c *Container) generateSpec(ctx context.Context) (*spec.Spec, error) {
|
||||
overrides := c.getUserOverrides()
|
||||
execUser, err := lookup.GetUserGroupInfo(c.state.Mountpoint, c.config.User, overrides)
|
||||
if err != nil {
|
||||
if util.StringInSlice(c.config.User, c.config.HostUsers) {
|
||||
if cutil.StringInSlice(c.config.User, c.config.HostUsers) {
|
||||
execUser, err = lookupHostUser(c.config.User)
|
||||
}
|
||||
if err != nil {
|
||||
@ -2389,7 +2390,7 @@ func (c *Container) generateResolvConf() error {
|
||||
}
|
||||
|
||||
if len(c.config.DNSSearch) > 0 || len(c.runtime.config.Containers.DNSSearches) > 0 {
|
||||
if !util.StringInSlice(".", c.config.DNSSearch) {
|
||||
if !cutil.StringInSlice(".", c.config.DNSSearch) {
|
||||
search = append(search, c.runtime.config.Containers.DNSSearches...)
|
||||
search = append(search, c.config.DNSSearch...)
|
||||
}
|
||||
|
Reference in New Issue
Block a user