Skip to content

Commit 6fa2a82

Browse files
authored
Merge branch 'master' into add_npipe
2 parents 0446591 + 38ee502 commit 6fa2a82

File tree

12 files changed

+100
-7
lines changed

12 files changed

+100
-7
lines changed

docker-java-api/src/main/java/com/github/dockerjava/api/DockerClient.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
import com.github.dockerjava.api.command.RemoveNetworkCmd;
5757
import com.github.dockerjava.api.command.RemoveSecretCmd;
5858
import com.github.dockerjava.api.command.RemoveServiceCmd;
59+
import com.github.dockerjava.api.command.RemoveSwarmNodeCmd;
5960
import com.github.dockerjava.api.command.RemoveVolumeCmd;
6061
import com.github.dockerjava.api.command.RenameContainerCmd;
6162
import com.github.dockerjava.api.command.ResizeContainerCmd;
@@ -342,6 +343,15 @@ public interface DockerClient extends Closeable {
342343
*/
343344
UpdateSwarmNodeCmd updateSwarmNodeCmd();
344345

346+
/**
347+
* Remove the swarm node
348+
*
349+
* @param swarmNodeId swarmNodeId
350+
* @return the command
351+
* @since 1.24
352+
*/
353+
RemoveSwarmNodeCmd removeSwarmNodeCmd(String swarmNodeId);
354+
345355
/**
346356
* List nodes in swarm
347357
*

docker-java-api/src/main/java/com/github/dockerjava/api/DockerClientDelegate.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
import com.github.dockerjava.api.command.RemoveNetworkCmd;
5757
import com.github.dockerjava.api.command.RemoveSecretCmd;
5858
import com.github.dockerjava.api.command.RemoveServiceCmd;
59+
import com.github.dockerjava.api.command.RemoveSwarmNodeCmd;
5960
import com.github.dockerjava.api.command.RemoveVolumeCmd;
6061
import com.github.dockerjava.api.command.RenameContainerCmd;
6162
import com.github.dockerjava.api.command.ResizeContainerCmd;
@@ -423,6 +424,11 @@ public UpdateSwarmNodeCmd updateSwarmNodeCmd() {
423424
return getDockerClient().updateSwarmNodeCmd();
424425
}
425426

427+
@Override
428+
public RemoveSwarmNodeCmd removeSwarmNodeCmd(String swarmNodeId) {
429+
return getDockerClient().removeSwarmNodeCmd(swarmNodeId);
430+
}
431+
426432
@Override
427433
public ListSwarmNodesCmd listSwarmNodesCmd() {
428434
return getDockerClient().listSwarmNodesCmd();

docker-java-api/src/main/java/com/github/dockerjava/api/command/LogContainerCmd.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
* @param since
2626
* - UNIX timestamp (integer) to filter logs. Specifying a timestamp will only output log-entries since that timestamp. Default:
2727
* 0 (unfiltered)
28+
* @param until
29+
* - Only return logs before this time, as a UNIX timestamp. Default: 0
2830
*/
2931
public interface LogContainerCmd extends AsyncDockerCmd<LogContainerCmd, Frame> {
3032

@@ -49,6 +51,9 @@ public interface LogContainerCmd extends AsyncDockerCmd<LogContainerCmd, Frame>
4951
@CheckForNull
5052
Integer getSince();
5153

54+
@CheckForNull
55+
Integer getUntil();
56+
5257
LogContainerCmd withContainerId(@Nonnull String containerId);
5358

5459
/**
@@ -69,6 +74,8 @@ public interface LogContainerCmd extends AsyncDockerCmd<LogContainerCmd, Frame>
6974

7075
LogContainerCmd withSince(Integer since);
7176

77+
LogContainerCmd withUntil(Integer until);
78+
7279
/**
7380
* @throws com.github.dockerjava.api.NotFoundException
7481
* No such container

docker-java-api/src/main/java/com/github/dockerjava/api/command/RemoveSwarmNodeCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public interface RemoveSwarmNodeCmd extends SyncDockerCmd<Void> {
1818
@CheckForNull
1919
Boolean hasForceEnabled();
2020

21-
RemoveSwarmNodeCmd withContainerId(@Nonnull String containerId);
21+
RemoveSwarmNodeCmd withSwarmNodeId(@Nonnull String swarmNodeId);
2222

2323
RemoveSwarmNodeCmd withForce(Boolean force);
2424

docker-java-api/src/main/java/com/github/dockerjava/api/model/ContainerMount.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public ContainerMount withDriver(String driver) {
106106
*/
107107
@CheckForNull
108108
public String getMode() {
109-
return driver;
109+
return mode;
110110
}
111111

112112
/**

docker-java-core/src/main/java/com/github/dockerjava/core/DockerClientImpl.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
import com.github.dockerjava.api.command.RemoveNetworkCmd;
5959
import com.github.dockerjava.api.command.RemoveSecretCmd;
6060
import com.github.dockerjava.api.command.RemoveServiceCmd;
61+
import com.github.dockerjava.api.command.RemoveSwarmNodeCmd;
6162
import com.github.dockerjava.api.command.RemoveVolumeCmd;
6263
import com.github.dockerjava.api.command.RenameContainerCmd;
6364
import com.github.dockerjava.api.command.ResizeContainerCmd;
@@ -140,6 +141,7 @@
140141
import com.github.dockerjava.core.command.RemoveNetworkCmdImpl;
141142
import com.github.dockerjava.core.command.RemoveSecretCmdImpl;
142143
import com.github.dockerjava.core.command.RemoveServiceCmdImpl;
144+
import com.github.dockerjava.core.command.RemoveSwarmNodeCmdImpl;
143145
import com.github.dockerjava.core.command.RemoveVolumeCmdImpl;
144146
import com.github.dockerjava.core.command.RenameContainerCmdImpl;
145147
import com.github.dockerjava.core.command.ResizeContainerCmdImpl;
@@ -616,6 +618,11 @@ public UpdateSwarmNodeCmd updateSwarmNodeCmd() {
616618
return new UpdateSwarmNodeCmdImpl(getDockerCmdExecFactory().updateSwarmNodeCmdExec());
617619
}
618620

621+
@Override
622+
public RemoveSwarmNodeCmd removeSwarmNodeCmd(String swarmNodeId) {
623+
return new RemoveSwarmNodeCmdImpl(getDockerCmdExecFactory().removeSwarmNodeCmdExec(), swarmNodeId);
624+
}
625+
619626
@Override
620627
public ListSwarmNodesCmd listSwarmNodesCmd() {
621628
return new ListSwarmNodesCmdImpl(getDockerCmdExecFactory().listSwarmNodeCmdExec());

docker-java-core/src/main/java/com/github/dockerjava/core/command/LogContainerCmdImpl.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@
2424
* @param since
2525
* - UNIX timestamp (integer) to filter logs. Specifying a timestamp will only output log-entries since that timestamp. Default:
2626
* 0 (unfiltered)
27+
* @param until
28+
* - Only return logs before this time, as a UNIX timestamp. Default: 0
2729
*/
2830
public class LogContainerCmdImpl extends AbstrAsyncDockerCmd<LogContainerCmd, Frame> implements LogContainerCmd {
2931

3032
private String containerId;
3133

3234
private Boolean followStream, timestamps, stdout, stderr;
3335

34-
private Integer tail, since;
36+
private Integer tail, since, until;
3537

3638
public LogContainerCmdImpl(LogContainerCmd.Exec exec, String containerId) {
3739
super(exec);
@@ -73,6 +75,11 @@ public Integer getSince() {
7375
return since;
7476
}
7577

78+
@Override
79+
public Integer getUntil() {
80+
return until;
81+
}
82+
7683
@Override
7784
public LogContainerCmd withContainerId(String containerId) {
7885
checkNotNull(containerId, "containerId was not specified");
@@ -122,6 +129,12 @@ public LogContainerCmd withSince(Integer since) {
122129
return this;
123130
}
124131

132+
@Override
133+
public LogContainerCmd withUntil(Integer until) {
134+
this.until = until;
135+
return this;
136+
}
137+
125138
@Override
126139
public String toString() {
127140
return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE);

docker-java-core/src/main/java/com/github/dockerjava/core/command/RemoveSwarmNodeCmdImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ public class RemoveSwarmNodeCmdImpl extends AbstrDockerCmd<RemoveSwarmNodeCmd, V
1717

1818
private Boolean force;
1919

20-
public RemoveSwarmNodeCmdImpl(RemoveSwarmNodeCmd.Exec exec, String containerId) {
20+
public RemoveSwarmNodeCmdImpl(RemoveSwarmNodeCmd.Exec exec, String swarmNodeId) {
2121
super(exec);
22-
withContainerId(containerId);
22+
withSwarmNodeId(swarmNodeId);
2323
}
2424

2525
@Override
@@ -35,7 +35,7 @@ public Boolean hasForceEnabled() {
3535
}
3636

3737
@Override
38-
public RemoveSwarmNodeCmd withContainerId(@Nonnull String swarmNodeId) {
38+
public RemoveSwarmNodeCmd withSwarmNodeId(@Nonnull String swarmNodeId) {
3939
checkNotNull(swarmNodeId, "swarmNodeId was not specified");
4040
this.swarmNodeId = swarmNodeId;
4141
return this;

docker-java-core/src/main/java/com/github/dockerjava/core/exec/LogContainerCmdExec.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ protected Void execute0(LogContainerCmd command, ResultCallback<Frame> resultCal
3232
webTarget = webTarget.queryParam("since", command.getSince());
3333
}
3434

35+
if (command.getUntil() != null) {
36+
webTarget = webTarget.queryParam("until", command.getUntil());
37+
}
38+
3539
webTarget = booleanQueryParam(webTarget, "timestamps", command.hasTimestampsEnabled());
3640
webTarget = booleanQueryParam(webTarget, "stdout", command.hasStdoutEnabled());
3741
webTarget = booleanQueryParam(webTarget, "stderr", command.hasStderrEnabled());

docker-java-core/src/main/java/com/github/dockerjava/core/util/CompressArchiveUtil.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ public static File archiveTARFiles(File base, Iterable<File> files, String archi
9898
tarFile.deleteOnExit();
9999
try (TarArchiveOutputStream tos = new TarArchiveOutputStream(new GZIPOutputStream(new BufferedOutputStream(
100100
new FileOutputStream(tarFile))))) {
101-
tos.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU);
101+
tos.setLongFileMode(TarArchiveOutputStream.LONGFILE_POSIX);
102+
tos.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_POSIX);
102103
for (File file : files) {
103104
// relativize with method using Path otherwise method with File resolves the symlinks
104105
// and this is not want we want. If the file is a symlink, the relativized path should

0 commit comments

Comments
 (0)