summaryrefslogtreecommitdiff
path: root/pkg/spec/spec.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-07-08 13:20:17 -0500
committerbaude <bbaude@redhat.com>2019-07-10 15:52:17 -0500
commite053e0e05ecd884067125627f0006d1b6e19226e (patch)
tree9e5bcca7703a041b23c2e3c9fcfe928e8bca2962 /pkg/spec/spec.go
parent81e722d08617ee19235bf57de6d86124e6b4574a (diff)
downloadpodman-e053e0e05ecd884067125627f0006d1b6e19226e.tar.gz
podman-e053e0e05ecd884067125627f0006d1b6e19226e.tar.bz2
podman-e053e0e05ecd884067125627f0006d1b6e19226e.zip
first pass of corrections for golangci-lint
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/spec/spec.go')
-rw-r--r--pkg/spec/spec.go8
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
}