summaryrefslogtreecommitdiff
path: root/pkg/domain
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/domain')
-rw-r--r--pkg/domain/entities/types/auth.go3
-rw-r--r--pkg/domain/entities/types/types.go3
-rw-r--r--pkg/domain/infra/abi/containers_runlabel.go25
-rw-r--r--pkg/domain/infra/abi/play.go1
4 files changed, 17 insertions, 15 deletions
diff --git a/pkg/domain/entities/types/auth.go b/pkg/domain/entities/types/auth.go
index ddf15bb18..7f2480173 100644
--- a/pkg/domain/entities/types/auth.go
+++ b/pkg/domain/entities/types/auth.go
@@ -1,4 +1,5 @@
-package types // import "github.com/docker/docker/api/types"
+// copied from github.com/docker/docker/api/types
+package types
// AuthConfig contains authorization information for connecting to a Registry
type AuthConfig struct {
diff --git a/pkg/domain/entities/types/types.go b/pkg/domain/entities/types/types.go
index 77834c0cb..7dc785078 100644
--- a/pkg/domain/entities/types/types.go
+++ b/pkg/domain/entities/types/types.go
@@ -1,4 +1,5 @@
-package types // import "github.com/docker/docker/api/types"
+// copied from github.com/docker/docker/api/types
+package types
// ComponentVersion describes the version information for a specific component.
type ComponentVersion struct {
diff --git a/pkg/domain/infra/abi/containers_runlabel.go b/pkg/domain/infra/abi/containers_runlabel.go
index 8de383926..2cabab988 100644
--- a/pkg/domain/infra/abi/containers_runlabel.go
+++ b/pkg/domain/infra/abi/containers_runlabel.go
@@ -177,6 +177,16 @@ func generateRunlabelCommand(runlabel string, img *image.Image, args []string, o
return cmd, env, nil
}
+func replaceName(arg, name string) string {
+ newarg := strings.ReplaceAll(arg, "$NAME", name)
+ return strings.ReplaceAll(newarg, "${NAME}", name)
+}
+
+func replaceImage(arg, image string) string {
+ newarg := strings.ReplaceAll(arg, "$IMAGE", image)
+ return strings.ReplaceAll(newarg, "${IMAGE}", image)
+}
+
// generateCommand takes a label (string) and converts it to an executable command
func generateCommand(command, imageName, name, globalOpts string) ([]string, error) {
if name == "" {
@@ -196,26 +206,15 @@ func generateCommand(command, imageName, name, globalOpts string) ([]string, err
for _, arg := range cmd[1:] {
var newArg string
switch arg {
- case "IMAGE":
- newArg = imageName
- case "$IMAGE":
- newArg = imageName
case "IMAGE=IMAGE":
newArg = fmt.Sprintf("IMAGE=%s", imageName)
- case "IMAGE=$IMAGE":
- newArg = fmt.Sprintf("IMAGE=%s", imageName)
- case "NAME":
- newArg = name
case "NAME=NAME":
newArg = fmt.Sprintf("NAME=%s", name)
- case "NAME=$NAME":
- newArg = fmt.Sprintf("NAME=%s", name)
- case "$NAME":
- newArg = name
case "$GLOBAL_OPTS":
newArg = globalOpts
default:
- newArg = arg
+ newArg = replaceName(arg, name)
+ newArg = replaceImage(newArg, imageName)
}
newCommand = append(newCommand, newArg)
}
diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go
index 52f759f13..6eecef2de 100644
--- a/pkg/domain/infra/abi/play.go
+++ b/pkg/domain/infra/abi/play.go
@@ -300,6 +300,7 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY
RestartPolicy: ctrRestartPolicy,
NetNSIsHost: p.NetNS.IsHost(),
SecretsManager: secretsManager,
+ LogDriver: options.LogDriver,
}
specGen, err := kube.ToSpecGen(ctx, &specgenOpts)
if err != nil {