8000 Use container status values from api by dmcgowan · Pull Request #49874 · moby/moby · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use container status values from api #49874

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2025

Conversation

dmcgowan
Copy link
Member
@dmcgowan dmcgowan commented Apr 26, 2025

Alias and deprecate the status types and constants from the root container package. The root container package is intended for use within the daemon and no the api package.

This is a part of separating the dependency of api to non-api packages.

- Human readable description for the release notes

Go SDK: container: deprecate `StateStatus`, `WaitCondition`, and the related  `WaitConditionNotRunning`, `WaitConditionNextExit`, and `WaitConditionRemoved` consts in favor of their equivalents in `api/types/container`.

@dmcgowan dmcgowan added this to the 28.2.0 milestone Apr 26, 2025
@dmcgowan dmcgowan requested a review from tonistiigi as a code owner April 26, 2025 00:23
@thaJeztah thaJeztah added area/api status/2-code-review impact/deprecation area/go-sdk Changes affecting the Go SDK impact/go-sdk Noteworthy (compatibility changes) in the Go SDK labels Apr 26, 2025
Copy link
Member
@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after the linting issue is fixed

daemon/wait.go Outdated
@@ -13,7 +14,7 @@ import (
// condition is met or if an error occurs waiting for the container (such as a
// context timeout or cancellation). On a successful wait, the exit code of the
// container is returned in the status with a non-nil Err() value.
func (daemon *Daemon) ContainerWait(ctx context.Context, name string, condition container.WaitCondition) (<-chan container.StateStatus, error) {
func (daemon *Daemon) ContainerWait(ctx context.Context, name string, condition containertypes.WaitCondition) (<-chan container.StateStatus, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

daemon/wait.go:17:119: SA1019: container.StateStatus is deprecated: use [container.StateStatus] instead. (staticcheck)
func (daemon *Daemon) ContainerWait(ctx context.Context, name string, condition containertypes.WaitCondition) (<-chan container.StateStatus, error) {
                                                                                                                      ^
Suggested change
func (daemon *Daemon) ContainerWait(ctx context.Context, name string, condition containertypes.WaitCondition) (<-chan container.StateStatus, error) {
func (daemon *Daemon) ContainerWait(ctx context.Context, name string, condition containertypes.WaitCondition) (<-chan containertypes.StateStatus, error) {

But it looks like this is the only remaining use of "github.com/docker/docker/container", so we could also remove the alias for the new import instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated it to be consistent with the daemon package. Another followup change could be done to make them consistent across packages.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I later noticed that, so we can keep the alias; linting issue needs to be fixed though to make CI happy 😁

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! You did, thanks!

Alias and deprecate the status types and constants from the root
container package. The root container package is intended for use
within the daemon and no the api package.

Signed-off-by: Derek McGowan <derek@mcg.dev>
@dmcgowan dmcgowan force-pushed the container-types-to-api branch from de5cb27 to 1001021 Compare April 26, 2025 14:58
@vvoland vvoland merged commit 9ee1716 into moby:master Apr 28, 2025
141 checks passed
@thaJeztah thaJeztah deleted the container-types-to-api branch April 28, 2025 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api area/go-sdk Changes affecting the Go SDK go-modules impact/deprecation impact/go-sdk Noteworthy (compatibility changes) in the Go SDK status/2-code-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0