Merge pull request #7951 from Iceber/fix_restart_monitor

This commit is contained in:
Fu Wei
2023-03-16 08:58:20 +08:00
committed by GitHub
2 changed files with 88 additions and 0 deletions

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.
switch desiredStatus {
case containerd.Running:
switch status.Status {
case containerd.Paused, containerd.Pausing:
continue
default:
}
if !restart.Reconcile(status, labels) {
continue
}
restartCount, _ := strconv.Atoi(labels[restart.CountLabel])
if labels["containerd.io/restart.logpath"] != "" {
logrus.Warn(`Label "containerd.io/restart.logpath" is no longer supported since containerd v2.0. Use "containerd.io/restart.loguri" instead.`)