Skip to content

Commit 3643312

Browse files
authored
Fetch s2iItems field for componentType names (#1698)
Signed-off-by: Denis Golovin <[email protected]>
1 parent b8f87c2 commit 3643312

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/odo.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ export class OdoImpl implements Odo {
637637

638638
public async getComponentTypesJson(): Promise<ComponentType[]> {
639639
const result: cliInstance.CliExitData = await this.execute(Command.listCatalogComponentsJson());
640-
return this.loadItems<ComponentType>(result);
640+
return this.loadItems<ComponentType>(result, (json) => json.s2iItems);
641641
}
642642

643643
public async getImageStreamRef(name: string, namespace: string): Promise<ImageStream> {
@@ -697,7 +697,7 @@ export class OdoImpl implements Odo {
697697

698698
public async getComponentTypeVersions(componentName: string): Promise<string[]> {
699699
const result: cliInstance.CliExitData = await this.execute(Command.listCatalogComponentsJson());
700-
const items = this.loadItems<ComponentType>(result).filter((value) => value.metadata.name === componentName);
700+
const items = this.loadItems<ComponentType>(result, (json) => json.s2iItems).filter((value) => value.metadata.name === componentName);
701701
return items.length > 0 ? items[0].spec.allTags : [];
702702
}
703703

test/unit/odo.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ suite("odo", () => {
448448
const odoCatalog = JSON.stringify({
449449
kind : "ComponentTypeList",
450450
apiVersion : "odo.openshift.io/v1alpha1",
451-
items: [
451+
s2iItems: [
452452
{
453453
kind : "ComponentType",
454454
apiVersion : "odo.openshift.io/v1alpha1",

0 commit comments

Comments
 (0)