summaryrefslogtreecommitdiff
path: root/libpod/container_internal.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 /libpod/container_internal.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 'libpod/container_internal.go')
-rw-r--r--libpod/container_internal.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index 1614211fb..106e2569b 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -219,14 +219,14 @@ func (c *Container) shouldRestart() bool {
// If we did not get a restart policy match, return false
// Do the same if we're not a policy that restarts.
if !c.state.RestartPolicyMatch ||
- c.config.RestartPolicy == RestartPolicyNo ||
- c.config.RestartPolicy == RestartPolicyNone {
+ c.config.RestartPolicy == define.RestartPolicyNo ||
+ c.config.RestartPolicy == define.RestartPolicyNone {
return false
}
// If we're RestartPolicyOnFailure, we need to check retries and exit
// code.
- if c.config.RestartPolicy == RestartPolicyOnFailure {
+ if c.config.RestartPolicy == define.RestartPolicyOnFailure {
if c.state.ExitCode == 0 {
return false
}
@@ -332,7 +332,7 @@ func (c *Container) syncContainer() error {
// Only save back to DB if state changed
if c.state.State != oldState {
// Check for a restart policy match
- if c.config.RestartPolicy != RestartPolicyNone && c.config.RestartPolicy != RestartPolicyNo &&
+ if c.config.RestartPolicy != define.RestartPolicyNone && c.config.RestartPolicy != define.RestartPolicyNo &&
(oldState == define.ContainerStateRunning || oldState == define.ContainerStatePaused) &&
(c.state.State == define.ContainerStateStopped || c.state.State == define.ContainerStateExited) &&
!c.state.StoppedByUser {