Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Added status column to Pod list #2675

Merged
merged 1 commit into from
Jul 27, 2021
Merged

Conversation

ftovaro
Copy link
Contributor

@ftovaro ftovaro commented Jul 23, 2021

Signed-off-by: ftovaro [email protected]

What this PR does / why we need it:
Adds a new column called Status that reflects the status of a Pod in addition to the Phase that is already on the table.

image

image

image

Which issue(s) this PR fixes

Special notes for your reviewer:

Release note:

release-note

@ftovaro ftovaro changed the title Printing status output Adding status column to Pod list Jul 23, 2021
@ftovaro ftovaro force-pushed the issue-201 branch 4 times, most recently from 5e3e3b7 to 56d7ffd Compare July 23, 2021 16:04
@ftovaro ftovaro changed the title Adding status column to Pod list Added status column to Pod list Jul 23, 2021
@ftovaro ftovaro force-pushed the issue-201 branch 2 times, most recently from 999d1a3 to a2057e8 Compare July 23, 2021 16:31
@ftovaro ftovaro marked this pull request as ready for review July 23, 2021 16:57
@@ -70,6 +70,22 @@ func PodListHandler(ctx context.Context, list *corev1.PodList, opts Options) (co

row["Phase"] = component.NewText(string(pod.Status.Phase))

if len(pod.Status.ContainerStatuses) > 0 {
lastStatus := pod.Status.ContainerStatuses[len(pod.Status.ContainerStatuses)-1]
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpicking here but the logic to determine the status can go inside a private method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could be but don't you think that the logic is too simple for that and also a method would have at least 3 lines of code and here we can have it with just one

@wwitzel3 wwitzel3 self-requested a review July 27, 2021 14:05
@wwitzel3 wwitzel3 merged commit a64680a into vmware-archive:master Jul 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show pod status in Workloads / Pods view
3 participants