mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 06:09:39 +08:00
fix(host): restart container on exit when AlwaysRestart is set (#24662)
This commit is contained in:
@@ -78,7 +78,7 @@ func (m *SGuestManager) reconcileContainer(obj *sPodGuestInstance, cache runtime
|
||||
// container is deleted
|
||||
continue
|
||||
}
|
||||
if cs.State == runtime.ContainerStateExited && cs.ExitCode != 0 {
|
||||
if cs.State == runtime.ContainerStateExited && (cs.ExitCode != 0 || ctr.Spec.AlwaysRestart) {
|
||||
if err := m.startContainer(obj, ctr, cs); err != nil {
|
||||
errs = append(errs, errors.Wrapf(err, "start container %s", ctr.Name))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user