-
Notifications
You must be signed in to change notification settings - Fork 601
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
Refactored container wait and make it public #2384
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Kevin Li <[email protected]>
allErr = multierror.Append(allErr, waitErr) | ||
} | ||
} | ||
return allErr | ||
} | ||
|
||
func waitContainer(ctx context.Context, w io.Writer, container containerd.Container) error { | ||
func WaitContainer(ctx context.Context, container containerd.Container) (code int64, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be pkg/containerutil.Wait()
https://github.com/containerd/nerdctl/blob/main/pkg/containerutil/containerutil.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs rebase |
Hey @KevinLiAWS Do you think you could rebase this? |
Wait container is useful for external callers.
The current container wait private method only return the error without the container status code, instead, it print the code.
This PR refactored the code to return both the status code and error, and make it public.
From docker API, the status code is int64, so converted the original uint32 to int64, and also use -1 to indicate non container wait error status.