Skip to content

Implement StopContainerRequest.restart - #94

Merged
alshabib merged 1 commit into
openconfig:masterfrom
f-sommerauer:containerz-stop-restart
Nov 5, 2026
Merged

alshabib merged 1 commit into
openconfig:masterfrom
f-sommerauer:containerz-stop-restart

Conversation

@f-sommerauer

Copy link
Copy Markdown
Collaborator

The gNOI containerz spec defines StopContainerRequest.restart: "If restart
is set, the target should start the container immediately after stopping
it." The server ignored the field, so a restart request only stopped the
container.

  • containers: add options.Restart().
  • server: pass options.Restart() to the manager when restart is set.
  • containers/docker: when Restart is set, call docker ContainerRestart
    with the same StopOptions timeout that ContainerStop uses. The container
    keeps its ID, configuration and restart policy. Behaviour without
    restart is unchanged.
  • client: StopContainer takes optional StopOptions; WithRestart() sets
    restart. Existing callers are unchanged.
  • cmd: add --restart to containerz container stop.

The gNOI containerz spec defines StopContainerRequest.restart: "If restart
is set, the target should start the container immediately after stopping
it." The server ignored the field, so a restart request only stopped the
container.

- containers: add options.Restart().
- server: pass options.Restart() to the manager when restart is set.
- containers/docker: when Restart is set, call docker ContainerRestart
  with the same StopOptions timeout that ContainerStop uses. The container
  keeps its ID, configuration and restart policy. Behaviour without
  restart is unchanged.
- client: StopContainer takes optional StopOptions; WithRestart() sets
  restart. Existing callers are unchanged.
- cmd: add --restart to `containerz container stop`.
@f-sommerauer
f-sommerauer marked this pull request as ready for review November 5, 2026 15:18
@f-sommerauer
f-sommerauer requested a review from alshabib November 5, 2026 17:43
@alshabib
alshabib merged commit f4d8132 into openconfig:master Nov 5, 2026
6 checks passed
@f-sommerauer
f-sommerauer deleted the containerz-stop-restart branch November 6, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants