summaryrefslogtreecommitdiff
path: root/pkg/spec/spec.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-07-11 01:22:30 +0200
committerGitHub <noreply@github.com>2019-07-11 01:22:30 +0200
commite2e8477f83f717d6a92badd317ae909cf185d04e (patch)
tree266259131bc70764b737cc65579641bd8140c533 /pkg/spec/spec.go
parentdf3f5afad13c91a6f2be9e83ae328483e047c13c (diff)
parente053e0e05ecd884067125627f0006d1b6e19226e (diff)
downloadpodman-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/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
}