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

crictl stats: complain if user is not root #427

Closed
wants to merge 1 commit into from

Conversation

lsm5
Copy link

@lsm5 lsm5 commented Jan 21, 2019

$ ./bin/crictl stats
FATA[0000] You're probably not root, your effective user id is 1000

$ sudo ./bin/crictl stats
CONTAINER CPU % MEM DISK INODES
07ac205b107e5 0.00 2.273MB 0B 0

Signed-off-by: Lokesh Mandvekar [email protected]

$ ./bin/crictl stats
FATA[0000] You're probably not root, your effective user id is 1000

 $ sudo ./bin/crictl stats
CONTAINER           CPU %               MEM                 DISK                INODES
07ac205b107e5       0.00                2.273MB             0B                  0

Signed-off-by: Lokesh Mandvekar <[email protected]>
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lsm5
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: yujuhong

If they are not already assigned, you can assign the PR to them by writing /assign @yujuhong in a comment when ready.

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

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 21, 2019
@lsm5
Copy link
Author

lsm5 commented Jan 21, 2019

@mrunalp PTAL

@@ -82,6 +82,10 @@ var statsCommand = cli.Command{
},
Action: func(context *cli.Context) error {
var err error
if userID := os.Geteuid(); userID != 0 {
logrus.Fatalf("You're probably not root, your effective user id is %d", userID)
Copy link
Member

Choose a reason for hiding this comment

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

nit: We could probably say "Root privileges required to connect to cri socket, your effective user id is %d"

@mrunalp
Copy link
Member

mrunalp commented Jan 23, 2019

We can close this in favor of #428

@mrunalp mrunalp closed this Jan 23, 2019
@lsm5 lsm5 deleted the check-root branch January 23, 2020 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants