Skip to content
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

Report errors when trying to pause rootless containers #4006

Merged
merged 1 commit into from
Sep 13, 2019

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Sep 12, 2019

If you are running a rootless container on cgroupV1
you can not pause the container. We need to report the proper error
if this happens.

Signed-off-by: Daniel J Walsh [email protected]

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M labels Sep 12, 2019
@@ -454,6 +456,15 @@ func (i *LibpodAPI) KillContainer(call iopodman.VarlinkCall, name string, signal

// PauseContainer ...
func (i *LibpodAPI) PauseContainer(call iopodman.VarlinkCall, name string) error {
if rootless.IsRootless() {
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to put this after the LookupContainer call? I think we'd want to report "No such container" before "Rootless doesn't support pause"?

@mheon
Copy link
Member

mheon commented Sep 12, 2019

We could put the check in libpod/container_internal.go in pause() - would only need it in one place then.

@rhatdan
Copy link
Member Author

rhatdan commented Sep 12, 2019

@mheon My concern there would be the error message might not be good,

@rhatdan
Copy link
Member Author

rhatdan commented Sep 13, 2019

@giuseppe
Copy link
Member

LGTM

return nil, errors.Wrap(err, "failed to determine cgroupversion")
}
if !cgroupv2 {
return nil, errors.Wrap(define.ErrNoCgroups, "can not pause pods on rootless containers with cgroup V1")
Copy link
Member

Choose a reason for hiding this comment

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

should this be: "can not pause pods containing rootless containers with cgroup V1" ? s/containing rootless/on rootless/

@TomSweeneyRedHat
Copy link
Member

TomSweeneyRedHat commented Sep 13, 2019

One possible grammar change, otherwise LGTM.

@rhatdan
Copy link
Member Author

rhatdan commented Sep 13, 2019

Fixes: #3970

If you are running a rootless container on cgroupV1
you can not pause the container.  We need to report the proper error
if this happens.

Signed-off-by: Daniel J Walsh <[email protected]>
return errors.Wrap(err, "failed to determine cgroupversion")
}
if !cgroupv2 {
return errors.Wrap(define.ErrNoCgroups, "can not pause containers on rootless containers with cgroup V1")
Copy link
Member

Choose a reason for hiding this comment

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

We should discard pause here and warn instead of erroring. We can't break existing rootless installs.

Copy link
Member Author

Choose a reason for hiding this comment

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

Wrong PR, I think this one should get in and then we open a specific one for podman cp.

Copy link
Member

Choose a reason for hiding this comment

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

Fair point.

@mheon
Copy link
Member

mheon commented Sep 13, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 13, 2019
@openshift-merge-robot openshift-merge-robot merged commit e8a44eb into containers:master Sep 13, 2019
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants