diff --git a/platform/platform-impl/src/com/intellij/remote/DockerCredentialsHolder.java b/platform/platform-impl/src/com/intellij/remote/DockerCredentialsHolder.java index de23886960be..580005da4332 100644 --- a/platform/platform-impl/src/com/intellij/remote/DockerCredentialsHolder.java +++ b/platform/platform-impl/src/com/intellij/remote/DockerCredentialsHolder.java @@ -22,13 +22,14 @@ import org.jetbrains.annotations.NotNull; * @author Alexander Koshevoy */ public class DockerCredentialsHolder { - public static final String DOCKER_SERVER_NAME = "DOCKER_SERVER_NAME"; + public static final String DOCKER_REMOTE_API_ADDRESS = "DOCKER_REMOTE_API_ADDRESS"; + public static final String DOCKER_CERTIFICATES_FOLDER = "DOCKER_CERTIFICATES_FOLDER"; public static final String DOCKER_IMAGE_NAME = "DOCKER_IMAGE_NAME"; public static final String DOCKER_CONTAINER_NAME = "DOCKER_CONTAINER_NAME"; public static final String DOCKER_REMOTE_PROJECT_PATH = "DOCKER_REMOTE_PROJECT_PATH"; - // TODO [Docker] do not store docker server itself but store id or special reference - private DockerSupport.DockerServer myDockerServer; + private String myRemoteAPIAddress; + private String myCertificatesFolder; private String myImageName; @@ -39,15 +40,24 @@ public class DockerCredentialsHolder { public DockerCredentialsHolder() { } - public DockerCredentialsHolder(DockerSupport.DockerServer server, String imageName, String containerName, String remoteProjectPath) { - myDockerServer = server; + public DockerCredentialsHolder(String remoteAPIAddress, + String certificatesFolder, + String imageName, + String containerName, + String remoteProjectPath) { + myRemoteAPIAddress = remoteAPIAddress; + myCertificatesFolder = certificatesFolder; myImageName = imageName; myContainerName = containerName; myRemoteProjectPath = remoteProjectPath; } - public DockerSupport.DockerServer getDockerServer() { - return myDockerServer; + public String getRemoteApiUrl() { + return myRemoteAPIAddress; + } + + public String getCertificatesFolder() { + return myCertificatesFolder; } public String getImageName() { @@ -63,23 +73,18 @@ public class DockerCredentialsHolder { } public void save(@NotNull Element element) { + element.setAttribute(DOCKER_REMOTE_API_ADDRESS, myRemoteAPIAddress); + element.setAttribute(DOCKER_CERTIFICATES_FOLDER, myCertificatesFolder); element.setAttribute(DOCKER_IMAGE_NAME, myImageName); element.setAttribute(DOCKER_CONTAINER_NAME, myContainerName); element.setAttribute(DOCKER_REMOTE_PROJECT_PATH, myRemoteProjectPath); - // TODO [Docker] use better Docker server id than its name - if (myDockerServer != null) { - element.setAttribute(DOCKER_SERVER_NAME, myDockerServer.getName()); - } } public void load(@NotNull Element element) { + myRemoteAPIAddress = element.getAttributeValue(DOCKER_REMOTE_API_ADDRESS); + myCertificatesFolder = element.getAttributeValue(DOCKER_CERTIFICATES_FOLDER); myImageName = element.getAttributeValue(DOCKER_IMAGE_NAME); myContainerName = element.getAttributeValue(DOCKER_CONTAINER_NAME); myRemoteProjectPath = element.getAttributeValue(DOCKER_REMOTE_PROJECT_PATH); - DockerSupport instance = DockerSupport.getInstance(); - if (instance != null) { - myDockerServer = instance.findDockerServerByName(element.getAttributeValue(DOCKER_SERVER_NAME)); - } } - } diff --git a/platform/platform-impl/src/com/intellij/remote/DockerSupport.java b/platform/platform-impl/src/com/intellij/remote/DockerSupport.java index f65afafe3ae8..f5d208fc83f0 100644 --- a/platform/platform-impl/src/com/intellij/remote/DockerSupport.java +++ b/platform/platform-impl/src/com/intellij/remote/DockerSupport.java @@ -16,11 +16,8 @@ package com.intellij.remote; import com.intellij.openapi.components.ServiceManager; -import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.List; - /** * @author Alexander Koshevoy */ @@ -29,15 +26,4 @@ public abstract class DockerSupport { public static DockerSupport getInstance() { return ServiceManager.getService(DockerSupport.class); } - - @NotNull - public abstract List getDockerServers(); - - @Nullable - public abstract DockerServer findDockerServerByName(@NotNull String name); - - public interface DockerServer { - @NotNull - String getName(); - } } diff --git a/python/src/com/jetbrains/python/sdk/PythonSdkType.java b/python/src/com/jetbrains/python/sdk/PythonSdkType.java index fe72fd791e32..ab1738fc80ff 100644 --- a/python/src/com/jetbrains/python/sdk/PythonSdkType.java +++ b/python/src/com/jetbrains/python/sdk/PythonSdkType.java @@ -1037,7 +1037,6 @@ public class PythonSdkType extends SdkType { @Override public void docker(@NotNull DockerCredentialsHolder credentials) { - result.set(credentials.getDockerServer() == null); } }); return result.get();