Adjusting implementation of delay-days to those suggested in PR review comments, to perform necessary checks in update.go. Added some comments where useful for understanding existing functionality.
log.Infof("New image found for %s that was created %d day(s) ago but update delayed until %d day(s) after creation",targetContainer.Name(),imageAgeDays,params.DelayDays)
// technically the container is stale but we set it to false here because it is this stale flag that tells downstream methods whether to perform the update
// containersToUpdate will contain all containers, not just those that need to be updated. The "stale" flag is checked via container.ToRestart()
// within stopContainersInReversedOrder and restartContainersInSortedOrder to skip over containers with stale set to false (unless LinkedToRestarting set)
log.Infof("New image found for %s that was created %d day(s) ago but update delayed until %d day(s) after creation",container.Name(),diffDays,requiredDays)
returnfalse,currentImageID,nil
}
}
}
log.Infof("Found new %s image (%s)",imageName,newImageID.ShortID())