use of org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource in project jbosstools-openshift by jbosstools.
the class OpenShiftUtils method getOpenShiftPod.
public static OpenShiftResource getOpenShiftPod(String projectName, Resource resource, Matcher<String> matcher, Connection connection) {
assertTrue(!StringUtils.isBlank(projectName));
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
List<OpenShiftResource> pods = explorer.getOpenShift3Connection(connection).getProject(projectName).getOpenShiftResources(resource);
for (OpenShiftResource pod : pods) {
if (matcher.matches(pod.getName())) {
return pod;
}
}
fail("Pod with matcher:" + matcher.toString() + " for project " + projectName + " was not found");
return null;
}
Aggregations