Skip to content

Commit b787b09

Browse files
authored
Rename kind property to avoid conflict with proposed API (#2315)
Signed-off-by: Denis Golovin [email protected]
1 parent 1b90a6f commit b787b09

File tree

4 files changed

+22
-17
lines changed

4 files changed

+22
-17
lines changed

package-lock.json

Lines changed: 13 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/odo/componentType.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ export interface ImageStreamTag {
3434
}
3535

3636
export function ascDevfileFirst(c1: ComponentType, c2: ComponentType): number {
37-
if(c1.kind !== c2.kind) {
38-
return c1.kind === ComponentKind.DEVFILE? -1: 1;
37+
if(c1.type !== c2.type) {
38+
return c1.type === ComponentKind.DEVFILE? -1: 1;
3939
}
4040
return c1.label.localeCompare(c2.label)
4141
}
@@ -76,7 +76,7 @@ export interface ComponentType {
7676
label: string;
7777
description: string;
7878
name: string;
79-
kind: ComponentKind;
79+
type: ComponentKind;
8080
version: string;
8181
}
8282

@@ -87,7 +87,7 @@ export interface ComponentTypeDescription {
8787

8888
export class ComponentTypeAdapter implements ComponentType {
8989
constructor(
90-
public readonly kind: ComponentKind,
90+
public readonly type: ComponentKind,
9191
public readonly name: string,
9292
public readonly version: string,
9393
public readonly description: string,

src/openshift/component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ export class Component extends OpenShiftItem {
653653
progressIndicator.show();
654654
const componentTypes = await Component.odo.getComponentTypes();
655655
if (componentTypeName) {
656-
componentTypeCandidates = componentTypes.filter(type => type.name === componentTypeName && type.kind === componentKind && (!version || type.version === version));
656+
componentTypeCandidates = componentTypes.filter(type => type.name === componentTypeName && type.type === componentKind && (!version || type.version === version));
657657
if (componentTypeCandidates?.length === 0) {
658658
componentType = await window.showQuickPick(componentTypes.sort(ascDevfileFirst), { placeHolder: `Cannot find Component type '${componentTypeName}', select one below to use instead`, ignoreFocusOut: true });
659659
} else if (componentTypeCandidates?.length > 1) {
@@ -668,7 +668,7 @@ export class Component extends OpenShiftItem {
668668

669669
if (!componentType) return createCancelledResult('componentType');
670670

671-
if (componentType.kind === ComponentKind.DEVFILE) {
671+
if (componentType.type === ComponentKind.DEVFILE) {
672672
progressIndicator.placeholder = 'Checking if provided context folder is empty'
673673
progressIndicator.show();
674674
const globbyPath = `${folder.fsPath.replace('\\', '/')}/`;
@@ -778,13 +778,13 @@ export class Component extends OpenShiftItem {
778778
return result;
779779
}
780780
const components = await Component.odo.getComponentTypes();
781-
const componentBuilder: ComponentTypeAdapter = components.find((comonentType) => comonentType.kind === component.kind? comonentType.name === component.builderImage.name : false);
781+
const componentBuilder: ComponentTypeAdapter = components.find((comonentType) => comonentType.type === component.kind? comonentType.name === component.builderImage.name : false);
782782
let isJava: boolean;
783783
let isNode: boolean;
784784
let isPython: boolean;
785785

786786
// TODO: https://github.com/redhat-developer/vscode-openshift-tools/issues/38
787-
if (componentBuilder && componentBuilder.tags && componentBuilder.kind === ComponentKind.S2I) { // s2i component has been selected for debug
787+
if (componentBuilder && componentBuilder.tags && componentBuilder.type === ComponentKind.S2I) { // s2i component has been selected for debug
788788
isJava = componentBuilder.tags.includes('java');
789789
isNode = componentBuilder.tags.includes('nodejs');
790790
isPython = componentBuilder.tags.includes('python');

test/integration/command.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ suite('odo commands integration', () => {
154154

155155
test('describeCatalogComponent()', async function () {
156156
const types = await ODO.getComponentTypes();
157-
const devfileCompType = types.find((compType) => compType.kind === ComponentKind.DEVFILE);
157+
const devfileCompType = types.find((compType) => compType.type === ComponentKind.DEVFILE);
158158
if (!devfileCompType) {
159159
this.skip();
160160
} else {

0 commit comments

Comments
 (0)