Search in sources :

Example 1 with ImageStreamTagMetaData

use of org.jboss.tools.openshift.internal.core.docker.ImageStreamTagMetaData in project jbosstools-openshift by jbosstools.

the class ApplicationSourceFromImageModel method lookupImageMetadata.

@Override
protected IDockerImageMetadata lookupImageMetadata() {
    if (source == null) {
        return null;
    }
    try {
        Connection conn = ConnectionsRegistryUtil.getConnectionFor(getProject());
        IResource istag = conn.getResource(ResourceKind.IMAGE_STREAM_TAG, source.getNamespace(), source.getName());
        return new ImageStreamTagMetaData(istag.toJson(true));
    } catch (Exception e) {
        OpenShiftUIActivator.getDefault().getLogger().logError(NLS.bind("Unable to retrieve imagestream tag for {0}", getImageName()), e);
    }
    return null;
}
Also used : ImageStreamTagMetaData(org.jboss.tools.openshift.internal.core.docker.ImageStreamTagMetaData) Connection(org.jboss.tools.openshift.core.connection.Connection) IResource(com.openshift.restclient.model.IResource) CoreException(org.eclipse.core.runtime.CoreException) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Aggregations

IResource (com.openshift.restclient.model.IResource)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 CoreException (org.eclipse.core.runtime.CoreException)1 Connection (org.jboss.tools.openshift.core.connection.Connection)1 ImageStreamTagMetaData (org.jboss.tools.openshift.internal.core.docker.ImageStreamTagMetaData)1