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

feat(dashboard): improve pods visibility #3483

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions USERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Organizations below are **officially** using Argo Rollouts. Please send a PR wit
1. [DaoCloud](https://daocloud.io)
1. [Databricks](https://github.com/databricks)
1. [Devtron Labs](https://github.com/devtron-labs/devtron)
1. [Factorial](https://factorialhr.com)
1. [Farfetch](https://www.farfetch.com/)
1. [Flipkart](https://flipkart.com)
1. [GetYourGuide](https://www.getyourguide.com)
Expand Down
20 changes: 16 additions & 4 deletions ui/src/app/components/pods/pods.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,17 @@ export enum PodStatus {
Unknown = 'unknown',
}

export const ParsePodStatus = (status: string): PodStatus => {
const isPodReady = (ready: string) => {
// Ready is a string in the format "0/1", "1/1", etc.
const [current, total] = ready.split('/');
return current === total;
};

export const ParsePodStatus = (status: string, ready: string): PodStatus => {
if (status === 'Running' && !isPodReady(ready)) {
return PodStatus.Pending;
}

switch (status) {
case 'Pending':
case 'Terminating':
Expand Down Expand Up @@ -101,10 +111,12 @@ export const ReplicaSet = (props: {rs: RolloutReplicaSetInfo; showRevision?: boo
key={pod.objectMeta?.uid}
name={pod.objectMeta?.name}
status={pod.status}
ready={pod.ready}
tooltip={
<div>
<div>Status: {pod.status}</div>
<div>{pod.objectMeta?.name}</div>
<div>Status: {pod.status}</div>
<div>Ready: {pod.ready}</div>
</div>
}
/>
Expand All @@ -115,7 +127,7 @@ export const ReplicaSet = (props: {rs: RolloutReplicaSetInfo; showRevision?: boo
);
};

export const PodWidget = ({name, status, tooltip, customIcon}: {name: string; status: string; tooltip: React.ReactNode; customIcon?: IconDefinition}) => {
export const PodWidget = ({name, status, ready, tooltip, customIcon}: {name: string; status: string; ready: string; tooltip: React.ReactNode; customIcon?: IconDefinition}) => {
let icon: IconDefinition;
let spin = false;
if (status.startsWith('Init:')) {
Expand All @@ -129,7 +141,7 @@ export const PodWidget = ({name, status, tooltip, customIcon}: {name: string; st
icon = faExclamationTriangle;
}

const className = ParsePodStatus(status);
const className = ParsePodStatus(status, ready);

if (customIcon) {
icon = customIcon;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import './rollout-grid-widget.scss';
export const isInProgress = (rollout: RolloutInfo): boolean => {
for (const rs of rollout.replicaSets || []) {
for (const p of rs.pods || []) {
const status = ParsePodStatus(p.status);
const status = ParsePodStatus(p.status, p.ready);
if (status === PodStatus.Pending) {
return true;
}
Expand Down
Loading