Fix restarting the paused containers
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
This commit is contained in:
		| @@ -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, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Iceber Gu
					Iceber Gu