libpod: do not stop pod on init ctr exit
Init containers are meant to exit early before other containers are started. Thus stopping the infra container in such case is wrong. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
parent
8a943311db
commit
30eb6b6aae
|
|
@ -2163,6 +2163,11 @@ func (c *Container) stopPodIfNeeded(ctx context.Context) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Never try to stop the pod when a init container stopped
|
||||||
|
if c.IsInitCtr() {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
pod, err := c.runtime.state.Pod(c.config.Pod)
|
pod, err := c.runtime.state.Pod(c.config.Pod)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("container %s is in pod %s, but pod cannot be retrieved: %w", c.ID(), c.config.Pod, err)
|
return fmt.Errorf("container %s is in pod %s, but pod cannot be retrieved: %w", c.ID(), c.config.Pod, err)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue