summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/domain/entities/pods.go5
-rw-r--r--pkg/domain/infra/abi/images.go6
-rw-r--r--pkg/signal/signal_linux.go7
-rw-r--r--pkg/specgen/pod_validate.go2
4 files changed, 13 insertions, 7 deletions
diff --git a/pkg/domain/entities/pods.go b/pkg/domain/entities/pods.go
index cd2e79961..9ca8ff43c 100644
--- a/pkg/domain/entities/pods.go
+++ b/pkg/domain/entities/pods.go
@@ -1,6 +1,7 @@
package entities
import (
+ "strings"
"time"
"github.com/containers/libpod/libpod"
@@ -121,7 +122,9 @@ func (p PodCreateOptions) ToPodSpecGen(s *specgen.PodSpecGenerator) {
s.Hostname = p.Hostname
s.Labels = p.Labels
s.NoInfra = !p.Infra
- s.InfraCommand = []string{p.InfraCommand}
+ if len(p.InfraCommand) > 0 {
+ s.InfraCommand = strings.Split(p.InfraCommand, " ")
+ }
s.InfraImage = p.InfraImage
s.SharedNamespaces = p.Share
diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go
index 24ee596be..6fc5eb9e3 100644
--- a/pkg/domain/infra/abi/images.go
+++ b/pkg/domain/infra/abi/images.go
@@ -394,8 +394,10 @@ func (ir *ImageEngine) Load(ctx context.Context, opts entities.ImageLoadOptions)
if err != nil {
return nil, errors.Wrap(err, "image loaded but no additional tags were created")
}
- if err := newImage.TagImage(opts.Name); err != nil {
- return nil, errors.Wrapf(err, "error adding %q to image %q", opts.Name, newImage.InputName)
+ if len(opts.Name) > 0 {
+ if err := newImage.TagImage(fmt.Sprintf("%s:%s", opts.Name, opts.Tag)); err != nil {
+ return nil, errors.Wrapf(err, "error adding %q to image %q", opts.Name, newImage.InputName)
+ }
}
return &entities.ImageLoadReport{Name: name}, nil
}
diff --git a/pkg/signal/signal_linux.go b/pkg/signal/signal_linux.go
index 76ab16ec7..e6e0f1ca1 100644
--- a/pkg/signal/signal_linux.go
+++ b/pkg/signal/signal_linux.go
@@ -129,14 +129,15 @@ func StopCatch(sigc chan os.Signal) {
// ParseSignalNameOrNumber translates a string to a valid syscall signal. Input
// can be a name or number representation i.e. "KILL" "9"
func ParseSignalNameOrNumber(rawSignal string) (syscall.Signal, error) {
- s, err := ParseSignal(rawSignal)
+ basename := strings.TrimPrefix(rawSignal, "-")
+ s, err := ParseSignal(basename)
if err == nil {
return s, nil
}
for k, v := range signalMap {
- if k == strings.ToUpper(rawSignal) {
+ if k == strings.ToUpper(basename) {
return v, nil
}
}
- return -1, fmt.Errorf("invalid signal: %s", rawSignal)
+ return -1, fmt.Errorf("invalid signal: %s", basename)
}
diff --git a/pkg/specgen/pod_validate.go b/pkg/specgen/pod_validate.go
index 50309f096..92026309f 100644
--- a/pkg/specgen/pod_validate.go
+++ b/pkg/specgen/pod_validate.go
@@ -25,7 +25,7 @@ func (p *PodSpecGenerator) validate() error {
return exclusivePodOptions("NoInfra", "InfraImage")
}
if len(p.SharedNamespaces) > 0 {
- return exclusivePodOptions("NoInfo", "SharedNamespaces")
+ return exclusivePodOptions("NoInfra", "SharedNamespaces")
}
}