summaryrefslogtreecommitdiff
path: root/pkg/systemd/generate/containers_test.go
diff options
context:
space:
mode:
authorPaul Holzinger <paul.holzinger@web.de>2021-03-15 12:55:06 +0100
committerPaul Holzinger <paul.holzinger@web.de>2021-03-15 14:02:04 +0100
commit57e8c66322849ff60e6126616c0c9883a80fb139 (patch)
treedc91b324d82675d66c6b1f37d6ca97c82597ae30 /pkg/systemd/generate/containers_test.go
parent762148deb6be6925d17bd12f219f7385e1402439 (diff)
downloadpodman-57e8c66322849ff60e6126616c0c9883a80fb139.tar.gz
podman-57e8c66322849ff60e6126616c0c9883a80fb139.tar.bz2
podman-57e8c66322849ff60e6126616c0c9883a80fb139.zip
Do not leak libpod package into the remote client
Some packages used by the remote client imported the libpod package. This is not wanted because it adds unnecessary bloat to the client and also causes problems with platform specific code(linux only), see #9710. The solution is to move the used functions/variables into extra packages which do not import libpod. This change shrinks the remote client size more than 6MB compared to the current master. [NO TESTS NEEDED] I have no idea how to test this properly but with #9710 the cross compile should fail. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'pkg/systemd/generate/containers_test.go')
-rw-r--r--pkg/systemd/generate/containers_test.go41
1 files changed, 21 insertions, 20 deletions
diff --git a/pkg/systemd/generate/containers_test.go b/pkg/systemd/generate/containers_test.go
index 747c54699..ebbbdb786 100644
--- a/pkg/systemd/generate/containers_test.go
+++ b/pkg/systemd/generate/containers_test.go
@@ -4,6 +4,7 @@ import (
"testing"
"github.com/containers/podman/v3/pkg/domain/entities"
+ "github.com/containers/podman/v3/pkg/systemd/define"
"github.com/stretchr/testify/assert"
)
@@ -398,7 +399,7 @@ WantedBy=multi-user.target default.target
PIDFile: "/run/containers/storage/overlay-containers/639c53578af4d84b8800b4635fa4e680ee80fd67e0e6a2d4eea48d1e3230f401/userdata/conmon.pid",
StopTimeout: 22,
PodmanVersion: "CI",
- EnvVariable: EnvVariable,
+ EnvVariable: define.EnvVariable,
},
goodID,
false,
@@ -414,7 +415,7 @@ WantedBy=multi-user.target default.target
PIDFile: "/run/containers/storage/overlay-containers/639c53578af4d84b8800b4635fa4e680ee80fd67e0e6a2d4eea48d1e3230f401/userdata/conmon.pid",
StopTimeout: 22,
PodmanVersion: "CI",
- EnvVariable: EnvVariable,
+ EnvVariable: define.EnvVariable,
},
goodIDNoHeaderInfo,
false,
@@ -430,7 +431,7 @@ WantedBy=multi-user.target default.target
PIDFile: "/run/containers/storage/overlay-containers/639c53578af4d84b8800b4635fa4e680ee80fd67e0e6a2d4eea48d1e3230f401/userdata/conmon.pid",
StopTimeout: 10,
PodmanVersion: "CI",
- EnvVariable: EnvVariable,
+ EnvVariable: define.EnvVariable,
},
goodName,
false,
@@ -447,7 +448,7 @@ WantedBy=multi-user.target default.target
StopTimeout: 10,
PodmanVersion: "CI",
BoundToServices: []string{"pod", "a", "b", "c"},
- EnvVariable: EnvVariable,
+ EnvVariable: define.EnvVariable,
},
goodNameBoundTo,
false,
@@ -462,7 +463,7 @@ WantedBy=multi-user.target default.target
PIDFile: "/run/containers/storage/overlay-containers/639c53578af4d84b8800b4635fa4e680ee80fd67e0e6a2d4eea48d1e3230f401/userdata/conmon.pid",
StopTimeout: 10,
PodmanVersion: "CI",
- EnvVariable: EnvVariable,
+ EnvVariable: define.EnvVariable,
},
"",
false,
@@ -479,7 +480,7 @@ WantedBy=multi-user.target default.target
StopTimeout: 10,
PodmanVersion: "CI",
CreateCommand: []string{"I'll get stripped", "container", "run", "--name", "jadda-jadda", "--hostname", "hello-world", "awesome-image:latest", "command", "arg1", "...", "argN", "foo=arg \"with \" space"},
- EnvVariable: EnvVariable,
+ EnvVariable: define.EnvVariable,
},
goodWithNameAndGeneric,
true,
@@ -496,7 +497,7 @@ WantedBy=multi-user.target default.target
StopTimeout: 10,
PodmanVersion: "CI",
CreateCommand: []string{"I'll get stripped", "run", "-d", "--name", "jadda-jadda", "--hostname", "hello-world", "awesome-image:latest", "command", "arg1", "...", "argN"},
- EnvVariable: EnvVariable,
+ EnvVariable: define.EnvVariable,
},
goodWithExplicitShortDetachParam,
true,
@@ -513,7 +514,7 @@ WantedBy=multi-user.target default.target
StopTimeout: 10,
PodmanVersion: "CI",
CreateCommand: []string{"I'll get stripped", "run", "-d", "--name", "jadda-jadda", "--hostname", "hello-world", "awesome-image:latest", "command", "arg1", "...", "argN"},
- EnvVariable: EnvVariable,
+ EnvVariable: define.EnvVariable,
Pod: &podInfo{
PodIDFile: "%t/pod-foobar.pod-id-file",
},
@@ -533,7 +534,7 @@ WantedBy=multi-user.target default.target
StopTimeout: 10,
PodmanVersion: "CI",
CreateCommand: []string{"I'll get stripped", "run", "--detach", "--name", "jadda-jadda", "--hostname", "hello-world", "awesome-image:latest", "command", "arg1", "...", "argN"},
- EnvVariable: EnvVariable,
+ EnvVariable: define.EnvVariable,
},
goodNameNewDetach,
true,
@@ -550,7 +551,7 @@ WantedBy=multi-user.target default.target
StopTimeout: 10,
PodmanVersion: "CI",
CreateCommand: []string{"I'll get stripped", "run", "awesome-image:latest"},
- EnvVariable: EnvVariable,
+ EnvVariable: define.EnvVariable,
},
goodIDNew,
true,
@@ -567,7 +568,7 @@ WantedBy=multi-user.target default.target
StopTimeout: 42,
PodmanVersion: "CI",
CreateCommand: []string{"I'll get stripped", "run", "--detach=true", "awesome-image:latest"},
- EnvVariable: EnvVariable,
+ EnvVariable: define.EnvVariable,
},
genGoodNewDetach("--detach=true"),
true,
@@ -584,7 +585,7 @@ WantedBy=multi-user.target default.target
StopTimeout: 42,
PodmanVersion: "CI",
CreateCommand: []string{"I'll get stripped", "run", "--detach=false", "awesome-image:latest"},
- EnvVariable: EnvVariable,
+ EnvVariable: define.EnvVariable,
},
genGoodNewDetach("-d"),
true,
@@ -601,7 +602,7 @@ WantedBy=multi-user.target default.target
StopTimeout: 42,
PodmanVersion: "CI",
CreateCommand: []string{"I'll get stripped", "run", "--name", "test", "-p", "80:80", "--detach=false", "awesome-image:latest", "somecmd", "--detach=false"},
- EnvVariable: EnvVariable,
+ EnvVariable: define.EnvVariable,
},
goodNameNewDetachFalseWithCmd,
true,
@@ -618,7 +619,7 @@ WantedBy=multi-user.target default.target
StopTimeout: 42,
PodmanVersion: "CI",
CreateCommand: []string{"I'll get stripped", "run", "--name", "test", "-p", "80:80", "--detach=false", "--detach=false", "awesome-image:latest", "somecmd", "--detach=false"},
- EnvVariable: EnvVariable,
+ EnvVariable: define.EnvVariable,
},
goodNameNewDetachFalseWithCmd,
true,
@@ -635,7 +636,7 @@ WantedBy=multi-user.target default.target
StopTimeout: 42,
PodmanVersion: "CI",
CreateCommand: []string{"I'll get stripped", "run", "-dti", "awesome-image:latest"},
- EnvVariable: EnvVariable,
+ EnvVariable: define.EnvVariable,
},
genGoodNewDetach("-dti"),
true,
@@ -652,7 +653,7 @@ WantedBy=multi-user.target default.target
StopTimeout: 42,
PodmanVersion: "CI",
CreateCommand: []string{"I'll get stripped", "run", "-tid", "awesome-image:latest"},
- EnvVariable: EnvVariable,
+ EnvVariable: define.EnvVariable,
},
genGoodNewDetach("-tid"),
true,
@@ -669,7 +670,7 @@ WantedBy=multi-user.target default.target
StopTimeout: 42,
PodmanVersion: "CI",
CreateCommand: []string{"I'll get stripped", "--events-backend", "none", "--runroot", "/root", "run", "awesome-image:latest"},
- EnvVariable: EnvVariable,
+ EnvVariable: define.EnvVariable,
},
goodNewRootFlags,
true,
@@ -686,7 +687,7 @@ WantedBy=multi-user.target default.target
StopTimeout: 10,
PodmanVersion: "CI",
CreateCommand: []string{"I'll get stripped", "container", "create", "awesome-image:latest"},
- EnvVariable: EnvVariable,
+ EnvVariable: define.EnvVariable,
},
goodContainerCreate,
true,
@@ -703,7 +704,7 @@ WantedBy=multi-user.target default.target
StopTimeout: 10,
PodmanVersion: "CI",
CreateCommand: []string{"I'll get stripped", "create", "--name", "test", "--log-driver=journald", "--log-opt=tag={{.Name}}", "awesome-image:latest"},
- EnvVariable: EnvVariable,
+ EnvVariable: define.EnvVariable,
},
goodNewWithJournaldTag,
true,
@@ -720,7 +721,7 @@ WantedBy=multi-user.target default.target
StopTimeout: 10,
PodmanVersion: "CI",
CreateCommand: []string{"I'll get stripped", "create", "--name", "test", "awesome-image:latest", "sh", "-c", "kill $$ && echo %\\"},
- EnvVariable: EnvVariable,
+ EnvVariable: define.EnvVariable,
},
goodNewWithSpecialChars,
true,