-
Notifications
You must be signed in to change notification settings - Fork 443
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
show concise image info for crictl ps #361
Conversation
|
93a0b40
to
020c311
Compare
cmd/crictl/container.go
Outdated
id = id[:truncatedIDLen] | ||
} | ||
} | ||
id := getTruncatedID(opts.noTrunc, c.Id, "") |
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.
I think this should be:
if !opts.noTrunc {
id := getTruncatedID(c.Id, "")
}
It is weird that function getTruncatedID
has a bool parameter to indicate returning a non-truncated id.
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.
done
cmd/crictl/container.go
Outdated
} | ||
id := getTruncatedID(opts.noTrunc, c.Id, "") | ||
// Now c.Image.Image is imageID in kubelet. | ||
imageID := getTruncatedID(opts.noTrunc, c.Image.Image, "sha256:") |
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.
Can we use go-digest
to parse the id here? We should only truncate when it is an image id.
The kubelet implementation may change in the future, we should not rely on it.
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.
done
020c311
to
080888e
Compare
Signed-off-by: yanxuean <yan.xuean@zte.com.cn>
080888e
to
d2bc823
Compare
|
btw: Can we display podid in "crictl ps", Now we don't know which pod these container belong to. |
e8b6f38
to
e2a2b95
Compare
/retest |
fix kubernetes-sigs#360 Signed-off-by: yanxuean <yan.xuean@zte.com.cn>
e2a2b95
to
eb736dc
Compare
/lgtm |
SGTM |
fix #360