diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-04-27 04:50:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-27 04:50:01 -0400 |
commit | 053b09660ffbe2df2104186c67e39be70764ff63 (patch) | |
tree | b9d8d32e146eb1ca1a3385e61b24d276dabc1cf0 /pkg/specgen/generate/namespaces.go | |
parent | 5ac00a7287e4a9e6292f4a6ca5dfa9a02e5ca907 (diff) | |
parent | 4f8ece76fff31d31570af56e0ec4a4092e015b33 (diff) | |
download | podman-053b09660ffbe2df2104186c67e39be70764ff63.tar.gz podman-053b09660ffbe2df2104186c67e39be70764ff63.tar.bz2 podman-053b09660ffbe2df2104186c67e39be70764ff63.zip |
Merge pull request #13997 from Luap99/gocritic
enable gocritic linter
Diffstat (limited to 'pkg/specgen/generate/namespaces.go')
-rw-r--r-- | pkg/specgen/generate/namespaces.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/pkg/specgen/generate/namespaces.go b/pkg/specgen/generate/namespaces.go index 2362f61c4..37d561ec2 100644 --- a/pkg/specgen/generate/namespaces.go +++ b/pkg/specgen/generate/namespaces.go @@ -202,10 +202,8 @@ func namespaceOptions(s *specgen.SpecGenerator, rt *libpod.Runtime, pod *libpod. if s.IDMappings != nil { if pod == nil { toReturn = append(toReturn, libpod.WithIDMappings(*s.IDMappings)) - } else { - if pod.HasInfraContainer() && (len(s.IDMappings.UIDMap) > 0 || len(s.IDMappings.GIDMap) > 0) { - return nil, errors.Wrapf(define.ErrInvalidArg, "cannot specify a new uid/gid map when entering a pod with an infra container") - } + } else if pod.HasInfraContainer() && (len(s.IDMappings.UIDMap) > 0 || len(s.IDMappings.GIDMap) > 0) { + return nil, errors.Wrapf(define.ErrInvalidArg, "cannot specify a new uid/gid map when entering a pod with an infra container") } } if s.User != "" { @@ -482,7 +480,7 @@ func GetNamespaceOptions(ns []string, netnsIsHost bool) ([]libpod.PodCreateOptio var options []libpod.PodCreateOption var erroredOptions []libpod.PodCreateOption if ns == nil { - //set the default namespaces + // set the default namespaces ns = strings.Split(specgen.DefaultKernelNamespaces, ",") } for _, toShare := range ns { |