Skip to content

Commit

Permalink
Bug 1798858: Fix bug where installed operators list status is missing…
Browse files Browse the repository at this point in the history
  • Loading branch information
rhamilto committed Feb 10, 2020
1 parent 61168ce commit 5bcc87c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@ export const Status: React.FC<StatusProps> = ({ status, title, children, iconOnl

case 'In Progress':
case 'Installing':
case 'InstallReady':
case 'Replacing':
case 'Running':
case 'Updating':
case 'Upgrading':
return <StatusIconAndText {...statusProps} icon={<SyncAltIcon />} />;

case 'Cancelled':
case 'Deleting':
case 'Expired':
case 'Not Ready':
case 'Terminating':
Expand Down Expand Up @@ -65,6 +68,7 @@ export const Status: React.FC<StatusProps> = ({ status, title, children, iconOnl
case 'Bound':
case 'Complete':
case 'Completed':
case 'Copied':
case 'Created':
case 'Enabled':
case 'Succeeded':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
ErrorStatus,
ProgressStatus,
Status,
SuccessStatus,
WarningStatus,
getNamespace,
getUID,
Expand Down Expand Up @@ -184,9 +183,9 @@ const ClusterServiceVersionStatus: React.FC<ClusterServiceVersionStatusProps> =
obj,
subscription,
}) => {
const statusString = _.get(obj, 'status.reason', ClusterServiceVersionPhase.CSVPhaseUnknown);
const showSuccessIcon = statusString === 'Copied' || statusString === 'InstallSucceeded';
const status = _.get(obj, 'status.phase');
const subscriptionStatus = getSubscriptionStatus(subscription);

if (obj.metadata.deletionTimestamp) {
return <>Disabling</>;
}
Expand All @@ -202,16 +201,16 @@ const ClusterServiceVersionStatus: React.FC<ClusterServiceVersionStatusProps> =

return (
<>
{_.get(obj, 'status.phase') !== ClusterServiceVersionPhase.CSVPhaseFailed ? (
<span className={classNames({ 'co-icon-and-text': showSuccessIcon })}>
{showSuccessIcon && <SuccessStatus title={statusString} />}
</span>
{status ? (
<>
<span className="co-icon-and-text">
<Status status={status} />
</span>
{subscription && <span className="text-muted">{subscriptionStatus.title}</span>}
</>
) : (
<span className="co-icon-and-text">
<ErrorStatus title={statusString} />
</span>
<Status status={ClusterServiceVersionPhase.CSVPhaseUnknown} />
)}
{subscription && <span className="text-muted">{subscriptionStatus.title}</span>}
</>
);
};
Expand Down

0 comments on commit 5bcc87c

Please sign in to comment.