Skip to content

Commit

Permalink
Bug 1811733: Show message when an InstallPlan fails
Browse files Browse the repository at this point in the history
The Subscription page was looking for `status.message` in the
InstallPlan, which is never set. Instead, read the message from the
InstallPlan failed condition to show an alert on the Subscription page.
Additionally, show all `status.conditions` on the InstallPlan page.
  • Loading branch information
spadgett committed Mar 9, 2020
1 parent 91a7ad1 commit 88fb96c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
Expand Up @@ -12,6 +12,7 @@ import {
TableRow,
TableData,
} from '@console/internal/components/factory';
import { Conditions } from '@console/internal/components/conditions';
import {
SectionHeading,
MsgBox,
Expand Down Expand Up @@ -316,6 +317,10 @@ export const InstallPlanDetails: React.SFC<InstallPlanDetailsProps> = ({ obj })
</div>
</div>
</div>
<div className="co-m-pane__body">
<SectionHeading text="Conditions" />
<Conditions conditions={obj.status?.conditions} />
</div>
</>
);
};
Expand Down
Expand Up @@ -310,7 +310,13 @@ export const SubscriptionDetails: React.FC<SubscriptionDetailsProps> = ({
const installedCSV = installedCSVForSubscription(clusterServiceVersions, obj);
const installPlan = installPlanForSubscription(installPlans, obj);
const installStatusPhase = _.get(installPlan, 'status.phase');
const installStatusMessage = _.get(installPlan, 'status.message') || 'Unknown';
const installPlanFailedCondition = installPlan?.status?.conditions?.find(
({ type, status }) => type === 'Installed' && status === 'False',
);
const installFailedMessage =
installPlanFailedCondition?.message ||
installPlanFailedCondition?.reason ||
'Install plan failed';

const pkg = packageForSubscription(packageManifests, obj);
if (new URLSearchParams(window.location.search).has('showDelete')) {
Expand All @@ -330,10 +336,12 @@ export const SubscriptionDetails: React.FC<SubscriptionDetailsProps> = ({
{installStatusPhase === InstallPlanPhase.InstallPlanPhaseFailed && (
<Alert
isInline
className="co-alert"
className="co-alert co-alert--scrollable"
variant="danger"
title={`${installStatusPhase}: ${installStatusMessage}`}
/>
title={installStatusPhase}
>
{installFailedMessage}
</Alert>
)}
<SectionHeading text="Subscription Details" />
<div className="co-m-pane__body-group">
Expand Down

0 comments on commit 88fb96c

Please sign in to comment.