-
Notifications
You must be signed in to change notification settings - Fork 707
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Checking for service catalog and service brokers installation and dep…
…loyed service instances (#86) * checks for service catalog, service brokers and service instances * review changes * moving checkCatalogInstalled into an action
- Loading branch information
Showing
8 changed files
with
132 additions
and
76 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import * as React from "react"; | ||
|
||
import { IClusterServiceClass } from "../../shared/ClusterServiceClass"; | ||
import { IServiceInstance } from "../../shared/ServiceInstance"; | ||
import { Card, CardContainer } from "../Card"; | ||
|
||
export interface InstanceCardListProps { | ||
classes: IClusterServiceClass[]; | ||
instances: IServiceInstance[]; | ||
} | ||
|
||
export const InstanceCardList = (props: InstanceCardListProps) => { | ||
const { instances, classes } = props; | ||
return ( | ||
<div className="InstanceCardList"> | ||
<section> | ||
<CardContainer> | ||
{instances.length > 0 && | ||
instances.map(instance => { | ||
const conditions = [...instance.status.conditions]; | ||
const status = conditions.shift(); // first in list is most recent | ||
const message = status ? status.message : ""; | ||
const svcClass = classes.find( | ||
potential => potential.metadata.name === instance.spec.clusterServiceClassRef.name, | ||
); | ||
const broker = svcClass && svcClass.spec.clusterServiceBrokerName; | ||
const icon = | ||
svcClass && | ||
svcClass.spec.externalMetadata && | ||
svcClass.spec.externalMetadata.imageUrl; | ||
|
||
const card = ( | ||
<Card | ||
key={instance.metadata.uid} | ||
header={ | ||
<span> | ||
{instance.metadata.namespace}/{instance.metadata.name} | ||
</span> | ||
} | ||
icon={icon} | ||
body={message} | ||
buttonText="Details" | ||
linkTo={`/services/brokers/${broker}/instances/${instance.metadata.namespace}/${ | ||
instance.metadata.name | ||
}/`} | ||
notes={<span>{instance.spec.clusterServicePlanExternalName}</span>} | ||
/> | ||
); | ||
return card; | ||
})} | ||
</CardContainer> | ||
</section> | ||
</div> | ||
); | ||
}; |
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
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