diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-07-11 01:22:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-11 01:22:30 +0200 |
commit | e2e8477f83f717d6a92badd317ae909cf185d04e (patch) | |
tree | 266259131bc70764b737cc65579641bd8140c533 /pkg/spec | |
parent | df3f5afad13c91a6f2be9e83ae328483e047c13c (diff) | |
parent | e053e0e05ecd884067125627f0006d1b6e19226e (diff) | |
download | podman-e2e8477f83f717d6a92badd317ae909cf185d04e.tar.gz podman-e2e8477f83f717d6a92badd317ae909cf185d04e.tar.bz2 podman-e2e8477f83f717d6a92badd317ae909cf185d04e.zip |
Merge pull request #3521 from baude/golangcilint1
first pass of corrections for golangci-lint
Diffstat (limited to 'pkg/spec')
-rw-r--r-- | pkg/spec/spec.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pkg/spec/spec.go b/pkg/spec/spec.go index 06d1ac12d..5cc021bf5 100644 --- a/pkg/spec/spec.go +++ b/pkg/spec/spec.go @@ -475,7 +475,9 @@ func addPidNS(config *CreateConfig, g *generate.Generator) error { func addUserNS(config *CreateConfig, g *generate.Generator) error { if IsNS(string(config.UsernsMode)) { - g.AddOrReplaceLinuxNamespace(spec.UserNamespace, NS(string(config.UsernsMode))) + if err := g.AddOrReplaceLinuxNamespace(spec.UserNamespace, NS(string(config.UsernsMode))); err != nil { + return err + } // runc complains if no mapping is specified, even if we join another ns. So provide a dummy mapping g.AddLinuxUIDMapping(uint32(0), uint32(0), uint32(1)) @@ -483,7 +485,9 @@ func addUserNS(config *CreateConfig, g *generate.Generator) error { } if (len(config.IDMappings.UIDMap) > 0 || len(config.IDMappings.GIDMap) > 0) && !config.UsernsMode.IsHost() { - g.AddOrReplaceLinuxNamespace(spec.UserNamespace, "") + if err := g.AddOrReplaceLinuxNamespace(spec.UserNamespace, ""); err != nil { + return err + } } return nil } |