From 57e8c66322849ff60e6126616c0c9883a80fb139 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Mon, 15 Mar 2021 12:55:06 +0100 Subject: 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 --- pkg/systemd/generate/pods.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg/systemd/generate/pods.go') diff --git a/pkg/systemd/generate/pods.go b/pkg/systemd/generate/pods.go index 8c0401278..f96058d36 100644 --- a/pkg/systemd/generate/pods.go +++ b/pkg/systemd/generate/pods.go @@ -11,6 +11,7 @@ import ( "github.com/containers/podman/v3/libpod" "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/systemd/define" "github.com/containers/podman/v3/version" "github.com/pkg/errors" "github.com/sirupsen/logrus" @@ -237,7 +238,7 @@ func executePodTemplate(info *podInfo, options entities.GenerateSystemdOptions) info.Executable = executable } - info.EnvVariable = EnvVariable + info.EnvVariable = define.EnvVariable info.ExecStart = "{{{{.Executable}}}} start {{{{.InfraNameOrID}}}}" info.ExecStop = "{{{{.Executable}}}} stop {{{{if (ge .StopTimeout 0)}}}}-t {{{{.StopTimeout}}}}{{{{end}}}} {{{{.InfraNameOrID}}}}" info.ExecStopPost = "{{{{.Executable}}}} stop {{{{if (ge .StopTimeout 0)}}}}-t {{{{.StopTimeout}}}}{{{{end}}}} {{{{.InfraNameOrID}}}}" -- cgit v1.2.3-54-g00ecf