Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerConnectionInfo.java25
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerExit.java2
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerInfo.java7
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerInfo2.java26
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerMount.java37
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerState.java2
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnectionInfo.java12
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerExit.java4
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerInfo.java32
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerMount.java80
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerState.java4
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/wizards/ImageSearch.java1
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ContainerInspectContentProvider.java3
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ContainerDataVolumeDialog.java20
14 files changed, 222 insertions, 33 deletions
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerConnectionInfo.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerConnectionInfo.java
index 8385785e4a..c5ef0bac1f 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerConnectionInfo.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerConnectionInfo.java
@@ -1,6 +1,6 @@
/*******************************************************************************
* Copyright (c) 2016, 2020 Red Hat.
- *
+ *
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
@@ -40,7 +40,14 @@ public interface IDockerConnectionInfo {
* @return the DockerRootDir
*/
String getDockerRootDir();
-
+
+ /**
+ * @return the executionDriver
+ * @deprecated this will be removed in Docker Tooling 5.0.0
+ */
+ @Deprecated
+ String getExecutionDriver();
+
/**
* @return the fileDescriptors
*/
@@ -65,17 +72,17 @@ public interface IDockerConnectionInfo {
* @return the initSha1
*/
String getInitSha1();
-
+
/**
* @return the IndexServerAddress
*/
String getIndexServerAddress();
-
+
/**
* @return the IPv4Forwarding flag
*/
boolean isIPv4Forwarding();
-
+
/**
* @return the kernelVersion
*/
@@ -85,7 +92,7 @@ public interface IDockerConnectionInfo {
* @return the Labels
*/
List<String> getLabels();
-
+
/**
* @return number of CPUs
*/
@@ -95,17 +102,17 @@ public interface IDockerConnectionInfo {
* @return total memory
*/
long getTotalMemory();
-
+
/**
* @return VM name
*/
String getName();
-
+
/**
* @return VM ID
*/
String getId();
-
+
/**
* @return the storageDriver
*/
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerExit.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerExit.java
index 397c787afa..93d11619ee 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerExit.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerExit.java
@@ -14,6 +14,6 @@ package org.eclipse.linuxtools.docker.core;
public interface IDockerContainerExit {
- Long statusCode();
+ Integer statusCode();
}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerInfo.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerInfo.java
index 9a02bc5f8d..65aa178c6d 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerInfo.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerInfo.java
@@ -14,8 +14,7 @@ package org.eclipse.linuxtools.docker.core;
import java.util.Date;
import java.util.List;
-
-import org.mandas.docker.client.messages.ContainerMount;
+import java.util.Map;
public interface IDockerContainerInfo {
@@ -53,7 +52,9 @@ public interface IDockerContainerInfo {
String mountLabel();
- List<ContainerMount> mounts();
+ Map<String, String> volumes();
+
+ Map<String, Boolean> volumesRW();
@Override
boolean equals(Object o);
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerInfo2.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerInfo2.java
new file mode 100644
index 0000000000..3ec2898214
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerInfo2.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Red Hat.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+import java.util.List;
+
+/**
+ * @since 4.7
+ * @author jjohnstn
+ *
+ */
+public interface IDockerContainerInfo2 {
+
+ List<IDockerContainerMount> mounts();
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerMount.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerMount.java
new file mode 100644
index 0000000000..28fa894eb7
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerMount.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Red Hat.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+/**
+ * @since 4.7
+ *
+ */
+public interface IDockerContainerMount {
+
+ String type();
+
+ String name();
+
+ String source();
+
+ String destination();
+
+ String driver();
+
+ String mode();
+
+ Boolean rw();
+
+ String propagation();
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerState.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerState.java
index fe91f07405..c33182f5fd 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerState.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerState.java
@@ -20,7 +20,7 @@ public interface IDockerContainerState {
Integer pid();
- Long exitCode();
+ Integer exitCode();
Date startDate();
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnectionInfo.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnectionInfo.java
index 1ff0964e11..b65ad04b0d 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnectionInfo.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnectionInfo.java
@@ -1,6 +1,6 @@
/*******************************************************************************
* Copyright (c) 2014, 2020 Red Hat.
- *
+ *
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
@@ -50,7 +50,7 @@ public class DockerConnectionInfo implements IDockerConnectionInfo {
private final boolean ipv4Forwarding;
private final List<String> labels;
private final String dockerRootDir;
-
+
public DockerConnectionInfo(final Info info, final Version version) {
this.containers = info != null ? info.containers() : -1;
this.debug = info != null ? info.debug() : false;
@@ -83,7 +83,7 @@ public class DockerConnectionInfo implements IDockerConnectionInfo {
: null;
this.labels = info != null ? info.labels() : null;
this.dockerRootDir = info != null ? info.dockerRootDir() : null;
-
+
}
@Override
@@ -209,4 +209,10 @@ public class DockerConnectionInfo implements IDockerConnectionInfo {
return dockerRootDir;
}
+ @Override
+ @Deprecated
+ public String getExecutionDriver() {
+ return null;
+ }
+
}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerExit.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerExit.java
index 25dfd79606..82b40d810d 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerExit.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerExit.java
@@ -23,8 +23,8 @@ public class DockerContainerExit implements IDockerContainerExit {
}
@Override
- public Long statusCode() {
- return statusCode;
+ public Integer statusCode() {
+ return Integer.valueOf(statusCode.intValue());
}
}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerInfo.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerInfo.java
index 267313070d..3357561901 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerInfo.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerInfo.java
@@ -12,18 +12,23 @@
*******************************************************************************/
package org.eclipse.linuxtools.internal.docker.core;
+import java.util.ArrayList;
import java.util.Date;
import java.util.List;
+import java.util.Map;
import org.eclipse.linuxtools.docker.core.IDockerContainerConfig;
import org.eclipse.linuxtools.docker.core.IDockerContainerInfo;
+import org.eclipse.linuxtools.docker.core.IDockerContainerInfo2;
+import org.eclipse.linuxtools.docker.core.IDockerContainerMount;
import org.eclipse.linuxtools.docker.core.IDockerContainerState;
import org.eclipse.linuxtools.docker.core.IDockerHostConfig;
import org.eclipse.linuxtools.docker.core.IDockerNetworkSettings;
import org.mandas.docker.client.messages.ContainerInfo;
import org.mandas.docker.client.messages.ContainerMount;
-public class DockerContainerInfo implements IDockerContainerInfo {
+public class DockerContainerInfo
+ implements IDockerContainerInfo, IDockerContainerInfo2 {
private String id;
private Date created;
@@ -42,7 +47,7 @@ public class DockerContainerInfo implements IDockerContainerInfo {
private String execDriver;
private String processLabel;
private String mountLabel;
- private List<ContainerMount> mounts;
+ private List<IDockerContainerMount> mounts;
public DockerContainerInfo (final ContainerInfo info) {
this.id = info != null ? info.id() : null;
@@ -66,7 +71,14 @@ public class DockerContainerInfo implements IDockerContainerInfo {
this.execDriver = info != null ? info.execDriver() : null;
this.processLabel = info != null ? info.processLabel() : null;
this.mountLabel = info != null ? info.mountLabel() : null;
- this.mounts = info != null ? info.mounts() : null;
+ if (info.mounts() != null) {
+ this.mounts = new ArrayList<>();
+ for (ContainerMount mount : info.mounts()) {
+ this.mounts.add(new DockerContainerMount(mount));
+ }
+ } else {
+ this.mounts = null;
+ }
}
@Override
@@ -155,8 +167,20 @@ public class DockerContainerInfo implements IDockerContainerInfo {
}
@Override
- public List<ContainerMount> mounts() {
+ public List<IDockerContainerMount> mounts() {
return mounts;
}
+ @Override
+ @Deprecated
+ public Map<String, String> volumes() {
+ return null;
+ }
+
+ @Override
+ @Deprecated
+ public Map<String, Boolean> volumesRW() {
+ return null;
+ }
+
}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerMount.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerMount.java
new file mode 100644
index 0000000000..11deeb675c
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerMount.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Red Hat.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.core;
+
+import org.eclipse.linuxtools.docker.core.IDockerContainerMount;
+import org.mandas.docker.client.messages.ContainerMount;
+
+public class DockerContainerMount implements IDockerContainerMount {
+
+ private String name;
+ private String source;
+ private String destination;
+ private String type;
+ private String driver;
+ private String mode;
+ private Boolean rw;
+ private String propagation;
+
+ public DockerContainerMount(final ContainerMount mount) {
+ this.name = mount.name();
+ this.source = mount.source();
+ this.destination = mount.destination();
+ this.type = mount.type();
+ this.driver = mount.driver();
+ this.mode = mount.mode();
+ this.rw = mount.rw();
+ this.propagation = mount.propagation();
+ }
+
+ @Override
+ public String type() {
+ return type;
+ }
+
+ @Override
+ public String name() {
+ return name;
+ }
+
+ @Override
+ public String source() {
+ return source;
+ }
+
+ @Override
+ public String destination() {
+ return destination;
+ }
+
+ @Override
+ public String driver() {
+ return driver;
+ }
+
+ @Override
+ public String mode() {
+ return mode;
+ }
+
+ @Override
+ public Boolean rw() {
+ return rw;
+ }
+
+ @Override
+ public String propagation() {
+ return propagation;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerState.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerState.java
index 7acef08c66..8975a0e3eb 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerState.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerState.java
@@ -58,8 +58,8 @@ public class DockerContainerState implements IDockerContainerState {
}
@Override
- public Long exitCode() {
- return exitCode;
+ public Integer exitCode() {
+ return Integer.valueOf(exitCode.intValue());
}
@Override
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/wizards/ImageSearch.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/wizards/ImageSearch.java
index 9a38cad3e5..afd044cf14 100644
--- a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/wizards/ImageSearch.java
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/wizards/ImageSearch.java
@@ -66,6 +66,7 @@ public class ImageSearch extends Wizard {
* @param connection the current connection to a target Docker daemon
* @param name the current image name or <code>null</code> if not
* applicable
+ * @since 4.7
*/
public ImageSearch(final IDockerConnection connection, final String name) {
this(connection, name, new RegistryInfo(AbstractRegistry.DOCKERHUB_REGISTRY, true));
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ContainerInspectContentProvider.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ContainerInspectContentProvider.java
index 69efd5c36b..ba73e65539 100644
--- a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ContainerInspectContentProvider.java
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ContainerInspectContentProvider.java
@@ -23,6 +23,7 @@ import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.linuxtools.docker.core.IDockerContainerConfig;
import org.eclipse.linuxtools.docker.core.IDockerContainerInfo;
+import org.eclipse.linuxtools.docker.core.IDockerContainerInfo2;
import org.eclipse.linuxtools.docker.core.IDockerContainerState;
import org.eclipse.linuxtools.docker.core.IDockerHostConfig;
import org.eclipse.linuxtools.docker.core.IDockerNetworkSettings;
@@ -64,7 +65,7 @@ public class ContainerInspectContentProvider implements ITreeContentProvider {
new Object[]{"Path", info.path()}, //$NON-NLS-1$
new Object[]{"ProcessLabel", info.processLabel()}, //$NON-NLS-1$
new Object[]{"ResolvConfPath", info.resolvConfPath()}, //$NON-NLS-1$
- new Object[] { "Mounts", info.mounts() }, //$NON-NLS-1$
+ new Object[] { "Mounts", ((IDockerContainerInfo2) info).mounts() }, //$NON-NLS-1$
};
}return EMPTY;
}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ContainerDataVolumeDialog.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ContainerDataVolumeDialog.java
index d79521910e..f4ff9ce995 100644
--- a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ContainerDataVolumeDialog.java
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ContainerDataVolumeDialog.java
@@ -41,7 +41,8 @@ import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.ComboViewer;
import org.eclipse.linuxtools.docker.core.IDockerConnection;
import org.eclipse.linuxtools.docker.core.IDockerContainer;
-import org.eclipse.linuxtools.docker.core.IDockerContainerInfo;
+import org.eclipse.linuxtools.docker.core.IDockerContainerInfo2;
+import org.eclipse.linuxtools.docker.core.IDockerContainerMount;
import org.eclipse.linuxtools.internal.docker.ui.SWTImagesFactory;
import org.eclipse.linuxtools.internal.docker.ui.wizards.ImageRunResourceVolumesVariablesModel.MountType;
import org.eclipse.swt.SWT;
@@ -57,7 +58,6 @@ import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
-import org.mandas.docker.client.messages.ContainerMount;
/**
* @author xcoulon
@@ -438,16 +438,22 @@ public class ContainerDataVolumeDialog extends Dialog {
// just make sure that the dialog cannot complete
return ValidationStatus.error(null);
}
- final IDockerContainerInfo selectedContainerInfo = container.info();
+ final IDockerContainerInfo2 selectedContainerInfo = (IDockerContainerInfo2) container.info();
if (selectedContainerInfo != null && selectedContainerInfo.mounts() != null
&& model.getContainerPath() != null) {
- for (ContainerMount mount : selectedContainerInfo.mounts()) {
+ boolean shouldWarn = true;
+ for (IDockerContainerMount mount : selectedContainerInfo.mounts()) {
if (model.getContainerPath().equals(mount.source())) {
- return ValidationStatus
- .warning(WizardMessages.getFormattedString("ContainerDataVolumeDialog.volumeWarning", //$NON-NLS-1$
- model.getContainerPath()));
+ shouldWarn = false;
+ break;
}
}
+ if (shouldWarn) {
+ return ValidationStatus
+ .warning(WizardMessages.getFormattedString("ContainerDataVolumeDialog.volumeWarning", //$NON-NLS-1$
+ model.getContainerPath()));
+
+ }
}
}
return ValidationStatus.ok();

Back to the top