aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/domain/infra/abi/containers_runlabel.go7
-rw-r--r--pkg/specgenutil/specgen.go8
2 files changed, 5 insertions, 10 deletions
diff --git a/pkg/domain/infra/abi/containers_runlabel.go b/pkg/domain/infra/abi/containers_runlabel.go
index b0aae4b76..716e77716 100644
--- a/pkg/domain/infra/abi/containers_runlabel.go
+++ b/pkg/domain/infra/abi/containers_runlabel.go
@@ -111,7 +111,6 @@ func generateRunlabelCommand(runlabel string, img *libimage.Image, inputName str
var (
err error
name, imageName string
- globalOpts string
cmd []string
)
@@ -144,7 +143,7 @@ func generateRunlabelCommand(runlabel string, img *libimage.Image, inputName str
runlabel = fmt.Sprintf("%s %s", runlabel, strings.Join(args, " "))
}
- cmd, err = generateCommand(runlabel, imageName, name, globalOpts)
+ cmd, err = generateCommand(runlabel, imageName, name)
if err != nil {
return nil, nil, err
}
@@ -209,7 +208,7 @@ func replaceImage(arg, image string) string {
}
// generateCommand takes a label (string) and converts it to an executable command
-func generateCommand(command, imageName, name, globalOpts string) ([]string, error) {
+func generateCommand(command, imageName, name string) ([]string, error) {
if name == "" {
name = imageName
}
@@ -231,8 +230,6 @@ func generateCommand(command, imageName, name, globalOpts string) ([]string, err
newArg = fmt.Sprintf("IMAGE=%s", imageName)
case "NAME=NAME":
newArg = fmt.Sprintf("NAME=%s", name)
- case "$GLOBAL_OPTS":
- newArg = globalOpts
default:
newArg = replaceName(arg, name)
newArg = replaceImage(newArg, imageName)
diff --git a/pkg/specgenutil/specgen.go b/pkg/specgenutil/specgen.go
index 637a6a8dd..5e4bd2f65 100644
--- a/pkg/specgenutil/specgen.go
+++ b/pkg/specgenutil/specgen.go
@@ -409,11 +409,9 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *entities.ContainerCreateOptions
s.WorkDir = c.Workdir
if c.Entrypoint != nil {
entrypoint := []string{}
- if ep := *c.Entrypoint; len(ep) > 0 {
- // Check if entrypoint specified is json
- if err := json.Unmarshal([]byte(*c.Entrypoint), &entrypoint); err != nil {
- entrypoint = append(entrypoint, ep)
- }
+ // Check if entrypoint specified is json
+ if err := json.Unmarshal([]byte(*c.Entrypoint), &entrypoint); err != nil {
+ entrypoint = append(entrypoint, *c.Entrypoint)
}
s.Entrypoint = entrypoint
}