From c1bcce294daee4835bb966e11a2ed092c5e973ce Mon Sep 17 00:00:00 2001 From: Denis Golovin Date: Mon, 17 May 2021 23:20:13 -0700 Subject: [PATCH] Detect s2i component by sourceType which is set only for s2i comps This PR fixes #2146. Signed-off-by: Denis Golovin dgolovin@redhat.com --- src/odo.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/odo.ts b/src/odo.ts index 6d0cec06e..7add45505 100644 --- a/src/odo.ts +++ b/src/odo.ts @@ -1049,7 +1049,7 @@ export class OdoImpl implements Odo { comp.contextValue = ContextType.COMPONENT_PUSHED; this.subject.next(new OdoEventImpl('changed', comp)); } else if (!comp) { - const newComponent = new OpenShiftComponent(app, added.metadata.name, ContextType.COMPONENT, Uri.file(added.status.context), added.spec.sourceType, added.spec.type.split(':')[1] ? ComponentKind.S2I : ComponentKind.DEVFILE, { name: added.spec.type.split(':')[0], tag: added.spec.type.split(':')[1]}); + const newComponent = new OpenShiftComponent(app, added.metadata.name, ContextType.COMPONENT, Uri.file(added.status.context), added.spec.sourceType, added.spec.sourceType ? ComponentKind.S2I : ComponentKind.DEVFILE, { name: added.spec.type.split(':')[0], tag: added.spec.type.split(':')[1]}); this.insertAndRefresh(newComponent); } } else if (!app) {