Repository navigation
fix use nerdctl stop a container but restart strategy still active - #6966
ningmingxiao wants to merge 1 commit into
Conversation
|
Hi @ningmingxiao. Thanks for your PR. I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
@AkihiroSuda |
bdc600f to
45c61bd
Compare
|
Although for compatibility with docker, but it is no different from |
|
How does Docker implement |
https://github.com/moby/moby/blob/b6dab55339382e2b6df0678a511a75c146daa45b/restartmanager/restartmanager.go#L128-L136 https://github.com/moby/moby/blob/b6dab55339382e2b6df0678a511a75c146daa45b/restartmanager/restartmanager.go#L62-L64 |
cpuguy83
left a comment
There was a problem hiding this comment.
Can you update the commit (and PR body) to explain what this change is and why its needed?
Is there an issue open that describes the problem?
I use nerdctl with --restart=always to run a container,then use nerdctl stop it,but this container still auto start. |
Why not use Is there another way we can give nerdctl more control of the behavior here while keeping |
78f1851 to
060125b
Compare
always and unless-stopped almost the same,except container with restart=always will auto start with daemon if container is not runing,so I add a func to start container wtih restart=always when containerd start |
cc7f41f to
567a366
Compare
|
ping @dmcgowan |
|
Do you have any suggestions for my pr? @AkihiroSuda |
| func (m *monitor) reconcile(ctx context.Context) error { | ||
| if m.reconcileTimes >= 0 && m.reconcileTimes < 2 { | ||
| m.reconcileTimes++ | ||
| } |
There was a problem hiding this comment.
I write old version like
func (m *monitor) reconcile(ctx context.Context) error {
m.reconcileTimes++
//then check it out of limit
if m.reconcileTimes == math.MaxInt64 {
m.reconcileTimes = 2
}
...
}
but I found m.reconcileTimes doesn't need to plus 1 at every time, I just need m.reconcileTimes=1 ,so I use
if m.reconcileTimes >= 0 && m.reconcileTimes < 2 {
m.reconcileTimes++
}
instead
| @@ -122,13 +122,17 @@ func (rp *Policy) MaximumRetryCount() int { | |||
|
|
|||
| // Reconcile reconciles the restart policy of a container. | |||
| func Reconcile(status containerd.Status, labels map[string]string) bool { | |||
Signed-off-by: ningmingxiao <[email protected]>
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
This PR is stale because it has been open 90 days with no activity. This PR will be closed in 7 days unless new comments are made or the stale label is removed. |
|
This PR was closed because it has been stalled for 7 days with no activity. |
No description provided.