-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 more detailed pod status on pod list page #1308
Conversation
Current coverage is 93.71% (diff: 87.50%)@@ master #1308 diff @@
==========================================
Files 342 342
Lines 3080 3101 +21
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 2888 2906 +18
- Misses 192 195 +3
Partials 0 0
|
a4234bb
to
b7d7091
Compare
} | ||
} | ||
if pod.DeletionTimestamp != nil { | ||
reason = "Terminating" |
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.
Do you have thoughts on internationalizing this? Entire UI is translated, but messages from the server aren't. Any solutions to this?
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.
Yah. This is a difficult one. Kubectl displays internal error names/strings rather than "messages" in the translatable sense. I'm not sure it's really translatable unless we break with kubectl and show something like "Error: %(reason)s" or something like that.
Perhaps that's a better approach?
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.
What I meant by that is that we could translate "Terminating" and other statuses we make up here, but sometimes it would show the "Reason" field from failed container statuses returned via the API and those won't be translatable.
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.
Yes. I think that's best solution. With the new i18n framework you could do this in the HTML via:
[[Error: {{$ctrl.errorReason}}|A description]]
@@ -30,14 +32,77 @@ func getRestartCount(pod api.Pod) int32 { | |||
return restartCount | |||
} | |||
|
|||
// getDisplayPods gets the status of the pod for display in a compact view like a list view. Logic is copied from kubectl ResourcePrinter implementation. | |||
func getDisplayStatus(pod api.Pod) string { |
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 have tests for this fuction? Looks like an easy candidate for a few unit tests.
Updated to have better messages that are translatable. Tests will be forthcoming. |
All right. Looks good. Please add tests now :) |
The linters... They hate me... |
@bryk Added tests and tamed the linters/compilers. PTAL. |
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.
Great, LGTM :)
This PR is meant to address #1121. Changed status on the pod list page to show the same status as kubectl.
Future work needed:
status.containerStatuses
and/orstatus.conditions
.