Fix restarting the paused containers

Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
This commit is contained in:
Iceber Gu 2023-01-11 15:41:00 +08:00
parent 689cd12ee6
commit e0d9b96631

View File

@ -171,9 +171,15 @@ func (m *monitor) monitor(ctx context.Context) ([]change, error) {
// which will result in an `on-failure` restart policy reconcile error. // which will result in an `on-failure` restart policy reconcile error.
switch desiredStatus { switch desiredStatus {
case containerd.Running: case containerd.Running:
switch status.Status {
case containerd.Paused, containerd.Pausing:
continue
default:
}
if !restart.Reconcile(status, labels) { if !restart.Reconcile(status, labels) {
continue continue
} }
restartCount, _ := strconv.Atoi(labels[restart.CountLabel]) restartCount, _ := strconv.Atoi(labels[restart.CountLabel])
changes = append(changes, &startChange{ changes = append(changes, &startChange{
container: c, container: c,