-
Notifications
You must be signed in to change notification settings - Fork 593
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
Bug 1798858: Fix bug where installed operators list status is missin… #4270
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,16 +8,7 @@ import { Helmet } from 'react-helmet'; | |
import { AddCircleOIcon } from '@patternfly/react-icons'; | ||
import { Alert, Card, CardBody, CardFooter, CardHeader } from '@patternfly/react-core'; | ||
import * as UIActions from '@console/internal/actions/ui'; | ||
import { | ||
ALL_NAMESPACES_KEY, | ||
ErrorStatus, | ||
ProgressStatus, | ||
Status, | ||
SuccessStatus, | ||
WarningStatus, | ||
getNamespace, | ||
getUID, | ||
} from '@console/shared'; | ||
import { ALL_NAMESPACES_KEY, Status, WarningStatus, getNamespace, getUID } from '@console/shared'; | ||
import { | ||
DetailsPage, | ||
Table, | ||
|
@@ -78,7 +69,6 @@ import { | |
InstallPlanKind, | ||
PackageManifestKind, | ||
SubscriptionKind, | ||
SubscriptionState, | ||
} from '../types'; | ||
import { subscriptionForCSV, getSubscriptionStatus } from '../status/csv-status'; | ||
import { getInternalObjects, isInternalObject } from '../utils'; | ||
|
@@ -88,8 +78,6 @@ import { operatorGroupFor, operatorNamespaceFor } from './operator-group'; | |
import { SubscriptionDetails, catalogSourceForSubscription } from './subscription'; | ||
import { ClusterServiceVersionLogo, referenceForProvidedAPI, providedAPIsFor } from './index'; | ||
|
||
const FAILED_SUBSCRIPTION_STATES = ['Unknown', SubscriptionState.SubscriptionStateFailed]; | ||
|
||
const isSubscription = (obj) => referenceFor(obj) === referenceForModel(SubscriptionModel); | ||
const isCSV = (obj) => referenceFor(obj) === referenceForModel(ClusterServiceVersionModel); | ||
const tableColumnClasses = [ | ||
|
@@ -184,11 +172,15 @@ 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'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The CLI does not use a default value (if |
||
const subscriptionStatus = getSubscriptionStatus(subscription); | ||
|
||
if (obj.metadata.deletionTimestamp) { | ||
return <>Disabling</>; | ||
return ( | ||
<span className="co-icon-and-text"> | ||
<Status status={ClusterServiceVersionPhase.CSVPhaseDeleting} /> | ||
</span> | ||
); | ||
} | ||
|
||
if (catalogSourceMissing) { | ||
|
@@ -202,16 +194,14 @@ 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> | ||
) : ( | ||
<span className="co-icon-and-text"> | ||
<ErrorStatus title={statusString} /> | ||
</span> | ||
)} | ||
{subscription && <span className="text-muted">{subscriptionStatus.title}</span>} | ||
{status ? ( | ||
<> | ||
<span className="co-icon-and-text"> | ||
<Status status={status} /> | ||
</span> | ||
{subscription && <span className="text-muted">{subscriptionStatus.title}</span>} | ||
</> | ||
) : null} | ||
</> | ||
); | ||
}; | ||
|
@@ -305,7 +295,7 @@ export const ClusterServiceVersionTableRow = withFallback<ClusterServiceVersionT | |
}, | ||
); | ||
|
||
export const FailedSubscriptionTableRow: React.FC<FailedSubscriptionTableRowProps> = ({ | ||
const SubscriptionTableRow: React.FC<SubscriptionTableRowProps> = ({ | ||
catalogSourceMissing, | ||
key, | ||
obj, | ||
|
@@ -326,22 +316,11 @@ export const FailedSubscriptionTableRow: React.FC<FailedSubscriptionTableRowProp | |
</> | ||
); | ||
} | ||
if (FAILED_SUBSCRIPTION_STATES.includes(subscriptionState)) { | ||
return ( | ||
<span className="co-icon-and-text"> | ||
<ErrorStatus title={subscriptionState} /> | ||
</span> | ||
); | ||
} | ||
|
||
if (subscriptionState === SubscriptionState.SubscriptionStateUpgradePending) { | ||
return ( | ||
<span className="co-icon-and-text"> | ||
<ProgressStatus title={subscriptionState} /> | ||
</span> | ||
); | ||
} | ||
return 'Unknown'; | ||
return ( | ||
<span className="co-icon-and-text"> | ||
<Status status={subscriptionState} /> | ||
</span> | ||
); | ||
}; | ||
|
||
return ( | ||
|
@@ -363,14 +342,14 @@ export const FailedSubscriptionTableRow: React.FC<FailedSubscriptionTableRowProp | |
<ResourceLink kind="Namespace" title={namespace} name={namespace} /> | ||
</TableData> | ||
|
||
{/* Status */} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was overlooked in #3712. |
||
<TableData className={tableColumnClasses[3]}>{getStatus()}</TableData> | ||
|
||
{/* Deployment */} | ||
<TableData className={tableColumnClasses[2]}> | ||
<span className="text-muted">None</span> | ||
</TableData> | ||
|
||
{/* Status */} | ||
<TableData className={tableColumnClasses[3]}>{getStatus()}</TableData> | ||
|
||
{/* Provided APIs */} | ||
<TableData className={tableColumnClasses[4]}> | ||
<span className="text-muted">None</span> | ||
|
@@ -405,7 +384,7 @@ const InstalledOperatorTableRow: React.FC<InstalledOperatorTableRowProps> = ({ | |
subscription={subscription} | ||
/> | ||
) : ( | ||
<FailedSubscriptionTableRow | ||
<SubscriptionTableRow | ||
{...rest} | ||
catalogSourceMissing={catalogSourceMissing} | ||
obj={subscription as SubscriptionKind} | ||
|
@@ -962,7 +941,7 @@ export type ClusterServiceVersionTableRowProps = { | |
subscription: SubscriptionKind; | ||
}; | ||
|
||
export type FailedSubscriptionTableRowProps = { | ||
type SubscriptionTableRowProps = { | ||
catalogSourceMissing: boolean; | ||
index: number; | ||
key?: string; | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This is not needed as this is a
status.reason
status.