You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// should use QuickPickItem with label and description
@@ -101,8 +102,20 @@ export class Component extends OpenShiftItem {
101
102
constcomponentToLink=awaitvscode.window.showQuickPick(componentPresent.filter((comp)=>comp.getName()!==context.getName()),{placeHolder: "Select the component to link"});
102
103
if(!componentToLink)returnnull;
103
104
105
+
constportsResult: CliExitData=awaitComponent.odo.execute(`oc get service ${componentToLink.getName()}-${app.getName()} --namespace ${project.getName()} -o jsonpath="{range .spec.ports[*]}{.port}{','}{end}"`);
port=awaitvscode.window.showQuickPick(ports,{placeHolder: "Select port to link"});
113
+
}else{
114
+
returnPromise.reject(`Component '${context.getName()}' has no ports decalred.`);
115
+
}
116
+
104
117
returnPromise.resolve()
105
-
.then(()=>Component.odo.execute(`odo link ${componentToLink.getName()}--app ${app.getName()}--project ${project.getName()}--component ${context.getName()} --wait`))
118
+
.then(()=>Component.odo.execute(`odo project set ${project.getName()}&& odo application set ${app.getName()}&& odo component set ${context.getName()}&& odo link ${componentToLink.getName()} --port ${port} --wait`))
106
119
.then(()=>`component '${componentToLink.getName()}' successfully linked with component '${context.getName()}'`)
107
120
.catch((err)=>Promise.reject(`Failed to link component with error '${err}'`));
0 commit comments