diff options
author | Paul Holzinger <paul.holzinger@web.de> | 2021-03-15 12:55:06 +0100 |
---|---|---|
committer | Paul Holzinger <paul.holzinger@web.de> | 2021-03-15 14:02:04 +0100 |
commit | 57e8c66322849ff60e6126616c0c9883a80fb139 (patch) | |
tree | dc91b324d82675d66c6b1f37d6ca97c82597ae30 /pkg/domain | |
parent | 762148deb6be6925d17bd12f219f7385e1402439 (diff) | |
download | podman-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/domain')
-rw-r--r-- | pkg/domain/filters/helpers.go | 20 | ||||
-rw-r--r-- | pkg/domain/infra/abi/play.go | 8 |
2 files changed, 4 insertions, 24 deletions
diff --git a/pkg/domain/filters/helpers.go b/pkg/domain/filters/helpers.go deleted file mode 100644 index 6a5fb68b1..000000000 --- a/pkg/domain/filters/helpers.go +++ /dev/null @@ -1,20 +0,0 @@ -package filters - -import ( - "net/url" - "strings" - - "github.com/pkg/errors" -) - -func ParseFilterArgumentsIntoFilters(filters []string) (url.Values, error) { - parsedFilters := make(url.Values) - for _, f := range filters { - t := strings.SplitN(f, "=", 2) - if len(t) < 2 { - return parsedFilters, errors.Errorf("filter input must be in the form of filter=value: %s is invalid", f) - } - parsedFilters.Add(t[0], t[1]) - } - return parsedFilters, nil -} diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go index b7ca69281..efc7c86e3 100644 --- a/pkg/domain/infra/abi/play.go +++ b/pkg/domain/infra/abi/play.go @@ -173,13 +173,13 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY var ctrRestartPolicy string switch podYAML.Spec.RestartPolicy { case v1.RestartPolicyAlways: - ctrRestartPolicy = libpod.RestartPolicyAlways + ctrRestartPolicy = define.RestartPolicyAlways case v1.RestartPolicyOnFailure: - ctrRestartPolicy = libpod.RestartPolicyOnFailure + ctrRestartPolicy = define.RestartPolicyOnFailure case v1.RestartPolicyNever: - ctrRestartPolicy = libpod.RestartPolicyNo + ctrRestartPolicy = define.RestartPolicyNo default: // Default to Always - ctrRestartPolicy = libpod.RestartPolicyAlways + ctrRestartPolicy = define.RestartPolicyAlways } configMaps := []v1.ConfigMap{} |