mirror of
https://github.com/floci-io/floci.git
synced 2026-11-22 21:50:46 -05:00
fix(ec2): report block-device attachment failures (#7690)
This commit is contained in:
1 parent
62de6a717b
commit
a99119e3b9
6 files changed
+574
-36
No files matched your search
@@ -1219,7 +1219,7 @@ When `floci.services.ec2.volume-block-devices` is enabled (the default), attache
|
||||
- **Storage mechanism**: Backing sparse raw image files are allocated in Floci storage under `floci-aws-ec2-volumes` (named volume or host path). A privileged helper container (`floci-aws-ec2-volume-helper`, running `floci.services.ec2.volume-helper-image`, default `alpine:3.21`) manages Linux loop devices via `losetup`. It starts on the first volume operation and is removed when Floci shuts down; the backing files stay in storage.
|
||||
- **Target device nodes**: Inside privileged target instance containers, the corresponding device node is created at the requested path (for example `/dev/xvdf` or `/dev/sdf`) using `mknod` or a symlink to the loop device, matching the exact size specified during volume creation. Target containers can format filesystems (such as ext4 or xfs), mount them, and persist data across detach and reattach.
|
||||
- **Restart reconciliation**: When an instance container stops and starts, or when Floci restarts, attached volume device nodes are automatically restored inside the target container. Backing raw files remain preserved across reboots in persistent storage.
|
||||
- **Graceful degradation**: If Docker is unavailable, the target instance container is not running, or the container is not privileged, volume attachments degrade gracefully to metadata-only tracking without failing the API call.
|
||||
- **Metadata-only tracking**: Disabling `floci.services.ec2.volume-block-devices`, EC2 mock mode, unavailable Docker, or a missing or stopped target container retains metadata-only attachment without failing the API call. Stopped instances have their device nodes restored when started. Once physical attachment is attempted, helper, loop-device, or guest device-creation failures return `InternalError` without recording a successful attachment; partial guest devices and loop devices allocated by the failed attempt are cleaned up on a best-effort basis so attachment can be retried. Reused loop devices are retained on failure. Insufficient privileges can cause these failures. Restart reconciliation logs device-restoration failures and keeps the existing attachment records for a later retry.
|
||||
- **Platform requirements**: Requires a Linux Docker environment (native Linux Docker daemon, or Colima / Docker Desktop with a Linux virtual machine) and privileged instance containers.
|
||||
- **Unmodeled aspects**: Multi-attach is tracked at metadata level only. Automated filesystem formatting (volumes start unformatted like real EBS block devices) and volume encryption at the block layer are not modeled. Root volume backing is logical (container rootfs); `ModifyVolume` updates recorded root volume metadata without modifying container storage, while EBS data volume size increases expand the underlying raw backing file and refresh any attached loop device. Volume type, IOPS, and throughput changes remain recorded metadata without altering device characteristics.
|
||||
|
||||
|
||||
@@ -1111,7 +1111,7 @@ public class Ec2Service implements ContainerTeardown, ResourceProvider, Resettab
|
||||
}
|
||||
if (inst.getDockerContainerId() != null
|
||||
&& containerManager.isContainerRunning(inst.getDockerContainerId())) {
|
||||
volumeBlockDeviceManager.attachVolume(vol, inst, att.getDevice());
|
||||
restoreVolumeDevice(vol, inst, att.getDevice());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1142,12 +1142,21 @@ public class Ec2Service implements ContainerTeardown, ResourceProvider, Resettab
|
||||
for (VolumeAttachment att : vol.getAttachments()) {
|
||||
if (inst.getInstanceId().equals(att.getInstanceId())
|
||||
&& (inst.getRootDeviceName() == null || !att.getDevice().equals(inst.getRootDeviceName()))) {
|
||||
volumeBlockDeviceManager.attachVolume(vol, inst, att.getDevice());
|
||||
restoreVolumeDevice(vol, inst, att.getDevice());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void restoreVolumeDevice(Volume volume, Instance instance, String device) {
|
||||
try {
|
||||
volumeBlockDeviceManager.attachVolume(volume, instance, device);
|
||||
} catch (AwsException e) {
|
||||
LOG.warnv("Could not restore volume {0} on instance {1}: {2}",
|
||||
volume.getVolumeId(), instance.getInstanceId(), e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether a container labelled for (region, instanceId) still backs a live instance record.
|
||||
* False means the record is gone or already terminated, so the container is an orphan.
|
||||
@@ -14567,6 +14576,9 @@ public class Ec2Service implements ContainerTeardown, ResourceProvider, Resettab
|
||||
}
|
||||
|
||||
private final ConcurrentHashMap<String, RefCountedLock> volumeLocks = new ConcurrentHashMap<>();
|
||||
private final Set<VolumeDevice> pendingVolumeAttachments = ConcurrentHashMap.newKeySet();
|
||||
|
||||
private record VolumeDevice(String accountId, String region, String instanceId, String device) {}
|
||||
|
||||
private <T> T withVolumeLock(String volumeId, Supplier<T> action) {
|
||||
if (volumeId == null) {
|
||||
@@ -14845,6 +14857,22 @@ public class Ec2Service implements ContainerTeardown, ResourceProvider, Resettab
|
||||
throw new AwsException("InvalidParameterValue",
|
||||
"Value '" + device + "' for parameter device is invalid.", 400);
|
||||
}
|
||||
return withVolumeLock(volumeId, () -> {
|
||||
String normalizedDevice = device.startsWith("/") ? device : "/dev/" + device;
|
||||
VolumeDevice target = new VolumeDevice(callerAccountId(), region, instanceId, normalizedDevice);
|
||||
if (!pendingVolumeAttachments.add(target)) {
|
||||
throw new AwsException("InvalidParameterValue",
|
||||
"The device '" + device + "' is already in use by an attachment in progress", 400);
|
||||
}
|
||||
try {
|
||||
return attachVolumeToInstance(region, volumeId, instanceId, device);
|
||||
} finally {
|
||||
pendingVolumeAttachments.remove(target);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private VolumeAttachment attachVolumeToInstance(String region, String volumeId, String instanceId, String device) {
|
||||
Volume volume = getRequiredVolume(region, volumeId);
|
||||
Instance inst = getRequiredInstance(region, instanceId);
|
||||
if (!List.of("running", "stopped").contains(inst.getState().getName())) {
|
||||
@@ -14881,6 +14909,10 @@ public class Ec2Service implements ContainerTeardown, ResourceProvider, Resettab
|
||||
}
|
||||
}
|
||||
|
||||
if (volumeBlockDeviceManager != null) {
|
||||
volumeBlockDeviceManager.attachVolume(volume, inst, device);
|
||||
}
|
||||
|
||||
VolumeAttachment attachment = new VolumeAttachment();
|
||||
attachment.setVolumeId(volumeId);
|
||||
attachment.setInstanceId(instanceId);
|
||||
@@ -14893,10 +14925,6 @@ public class Ec2Service implements ContainerTeardown, ResourceProvider, Resettab
|
||||
volume.setState("in-use");
|
||||
volumes.put(key(region, volumeId), volume);
|
||||
|
||||
if (volumeBlockDeviceManager != null) {
|
||||
volumeBlockDeviceManager.attachVolume(volume, inst, device);
|
||||
}
|
||||
|
||||
return attachment;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.github.dockerjava.api.DockerClient;
|
||||
import com.github.dockerjava.api.command.InspectContainerResponse;
|
||||
import com.github.dockerjava.api.exception.NotFoundException;
|
||||
import io.floci.aws.config.EmulatorConfig;
|
||||
import io.floci.aws.core.common.AwsException;
|
||||
import io.floci.aws.core.common.ContainerTeardown;
|
||||
import io.floci.aws.core.common.Resettable;
|
||||
import io.floci.aws.core.common.docker.ContainerBuilder;
|
||||
@@ -265,7 +266,8 @@ public class Ec2VolumeBlockDeviceManager implements ContainerTeardown, Resettabl
|
||||
* Attaches a volume to a target instance container as a block device.
|
||||
*
|
||||
* @return the device path inside the container if block device creation succeeded,
|
||||
* or empty if degraded or container was not running.
|
||||
* or empty for intentional metadata-only tracking.
|
||||
* @throws AwsException if physical attachment is attempted but fails
|
||||
*/
|
||||
public Optional<String> attachVolume(Volume volume, Instance instance, String requestedDevice) {
|
||||
if (!isAvailable()) {
|
||||
@@ -281,6 +283,9 @@ public class Ec2VolumeBlockDeviceManager implements ContainerTeardown, Resettabl
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
if (instance.getState() != null && "stopped".equals(instance.getState().getName())) {
|
||||
return Optional.empty();
|
||||
}
|
||||
String targetContainerId = instance.getDockerContainerId();
|
||||
if (targetContainerId == null || targetContainerId.isBlank()) {
|
||||
LOG.warnv("Instance {0} has no Docker container ID; volume {1} attached as metadata only",
|
||||
@@ -295,9 +300,7 @@ public class Ec2VolumeBlockDeviceManager implements ContainerTeardown, Resettabl
|
||||
|
||||
String helperId = ensureHelperContainer();
|
||||
if (helperId == null) {
|
||||
LOG.warnv("EC2 volume helper container unavailable; volume {0} attached as metadata only",
|
||||
volume.getVolumeId());
|
||||
return Optional.empty();
|
||||
throw attachmentFailure(volume, instance, null, null, null, "Volume helper container unavailable");
|
||||
}
|
||||
|
||||
int effectiveSize = volume.getSize() > 0 ? volume.getSize() : 8;
|
||||
@@ -306,6 +309,7 @@ public class Ec2VolumeBlockDeviceManager implements ContainerTeardown, Resettabl
|
||||
+ "file=\"$1\"\n"
|
||||
+ "size=\"$2\"\n"
|
||||
+ "[ -f \"$file\" ] || truncate -s \"${size}G\" \"$file\"\n"
|
||||
+ "allocated=0\n"
|
||||
+ "loop=$(find_loops \"$file\" | head -n1)\n"
|
||||
+ "if [ -z \"$loop\" ]; then\n"
|
||||
+ " loop=$(losetup -f 2>/dev/null)\n"
|
||||
@@ -315,11 +319,12 @@ public class Ec2VolumeBlockDeviceManager implements ContainerTeardown, Resettabl
|
||||
+ " mknod \"$loop\" b 7 \"$minor\" 2>/dev/null || true\n"
|
||||
+ " fi\n"
|
||||
+ " losetup \"$loop\" \"$file\" || exit 1\n"
|
||||
+ " allocated=1\n"
|
||||
+ " else\n"
|
||||
+ " exit 1\n"
|
||||
+ " fi\n"
|
||||
+ "fi\n"
|
||||
+ "echo \"$loop\"";
|
||||
+ "echo \"$allocated $loop\"";
|
||||
|
||||
ContainerExec.Result helperResult;
|
||||
synchronized (loopAllocationLock) {
|
||||
@@ -328,16 +333,17 @@ public class Ec2VolumeBlockDeviceManager implements ContainerTeardown, Resettabl
|
||||
DEFAULT_TIMEOUT_SECONDS);
|
||||
}
|
||||
if (helperResult.exitCode() != 0) {
|
||||
LOG.warnv("Failed to allocate loop device for volume {0} in helper: {1}",
|
||||
volume.getVolumeId(), helperResult.summary());
|
||||
return Optional.empty();
|
||||
throw attachmentFailure(volume, instance, null, null, null, helperResult.summary());
|
||||
}
|
||||
|
||||
String loopDev = helperResult.summary();
|
||||
if (loopDev == null || !loopDev.startsWith("/dev/loop")) {
|
||||
LOG.warnv("Unexpected loop device format for volume {0}: {1}", volume.getVolumeId(), loopDev);
|
||||
return Optional.empty();
|
||||
String[] allocation = helperResult.summary().split("\\s+");
|
||||
if (allocation.length != 2 || !("0".equals(allocation[0]) || "1".equals(allocation[0]))
|
||||
|| !allocation[1].matches("/dev/loop[0-9]+")) {
|
||||
throw attachmentFailure(volume, instance, null, null, null,
|
||||
"Unexpected loop allocation: " + helperResult.summary());
|
||||
}
|
||||
String loopDev = allocation[1];
|
||||
String allocatedLoop = "1".equals(allocation[0]) ? loopDev : null;
|
||||
activeLoopDevices.put(volume.getVolumeId(), loopDev);
|
||||
|
||||
String minorStr = loopDev.replaceAll("[^0-9]", "");
|
||||
@@ -355,15 +361,13 @@ public class Ec2VolumeBlockDeviceManager implements ContainerTeardown, Resettabl
|
||||
+ "else\n"
|
||||
+ " ln -sf \"$loop\" \"$dev\"\n"
|
||||
+ "fi\n"
|
||||
+ "[ -b \"$dev\" ] || [ -L \"$dev\" ]";
|
||||
+ "[ -b \"$dev\" ]";
|
||||
|
||||
ContainerExec.Result targetResult = execInContainer(targetContainerId,
|
||||
new String[]{"sh", "-c", targetScript, "target", normalizedDevice, loopDev, minorStr},
|
||||
DEFAULT_TIMEOUT_SECONDS);
|
||||
if (targetResult.exitCode() != 0) {
|
||||
LOG.warnv("Failed to create block device {0} in container {1} for volume {2}: {3}",
|
||||
normalizedDevice, targetContainerId, volume.getVolumeId(), targetResult.summary());
|
||||
return Optional.empty();
|
||||
throw attachmentFailure(volume, instance, helperId, allocatedLoop, normalizedDevice, targetResult.summary());
|
||||
}
|
||||
|
||||
LOG.infov("Attached volume {0} as block device {1} (loop device {2}) to instance {3}",
|
||||
@@ -390,18 +394,52 @@ public class Ec2VolumeBlockDeviceManager implements ContainerTeardown, Resettabl
|
||||
|
||||
String helperId = ensureHelperContainer();
|
||||
if (helperId != null) {
|
||||
String rawFile = "/volumes/" + volume.getVolumeId() + ".raw";
|
||||
String script = SHELL_LOOP_FINDER
|
||||
+ "raw=\"$1\"\n"
|
||||
+ "while true; do\n"
|
||||
+ " loop=$(find_loops \"$raw\" | head -n1)\n"
|
||||
+ " [ -n \"$loop\" ] || break\n"
|
||||
+ " losetup -d \"$loop\" 2>/dev/null || break\n"
|
||||
+ "done";
|
||||
execInContainer(helperId,
|
||||
new String[]{"sh", "-c", script, "detach", rawFile}, DEFAULT_TIMEOUT_SECONDS);
|
||||
releaseVolumeLoops(helperId, volume);
|
||||
}
|
||||
}
|
||||
|
||||
private AwsException attachmentFailure(Volume volume, Instance instance, String helperId,
|
||||
String allocatedLoop, String targetDevice, String reason) {
|
||||
LOG.warnv("Failed to attach volume {0} to instance {1}: {2}",
|
||||
volume.getVolumeId(), instance.getInstanceId(), reason);
|
||||
if (targetDevice != null) {
|
||||
ContainerExec.Result removed = execInContainer(instance.getDockerContainerId(),
|
||||
new String[]{"rm", "-f", targetDevice}, DEFAULT_TIMEOUT_SECONDS);
|
||||
if (removed.exitCode() != 0) {
|
||||
LOG.warnv("Could not clean up device {0} for volume {1}: {2}",
|
||||
targetDevice, volume.getVolumeId(), removed.summary());
|
||||
}
|
||||
}
|
||||
if (helperId != null && allocatedLoop != null) {
|
||||
ContainerExec.Result released = execInContainer(helperId,
|
||||
new String[]{"losetup", "-d", allocatedLoop}, DEFAULT_TIMEOUT_SECONDS);
|
||||
if (released.exitCode() != 0) {
|
||||
LOG.warnv("Could not release newly allocated loop {0} for volume {1}: {2}",
|
||||
allocatedLoop, volume.getVolumeId(), released.summary());
|
||||
} else {
|
||||
activeLoopDevices.remove(volume.getVolumeId(), allocatedLoop);
|
||||
}
|
||||
}
|
||||
return new AwsException("InternalError", "Could not attach volume '" + volume.getVolumeId()
|
||||
+ "' to instance '" + instance.getInstanceId() + "'", 500);
|
||||
}
|
||||
|
||||
private void releaseVolumeLoops(String helperId, Volume volume) {
|
||||
String script = SHELL_LOOP_FINDER
|
||||
+ "raw=\"$1\"\n"
|
||||
+ "failed=0\n"
|
||||
+ "for loop in $(find_loops \"$raw\"); do\n"
|
||||
+ " losetup -d \"$loop\" || failed=1\n"
|
||||
+ "done\n"
|
||||
+ "exit $failed";
|
||||
ContainerExec.Result released = execInContainer(helperId,
|
||||
new String[]{"sh", "-c", script, "detach", "/volumes/" + volume.getVolumeId() + ".raw"},
|
||||
DEFAULT_TIMEOUT_SECONDS);
|
||||
if (released.exitCode() != 0) {
|
||||
LOG.warnv("Could not release loop devices for volume {0}: {1}", volume.getVolumeId(), released.summary());
|
||||
} else {
|
||||
activeLoopDevices.remove(volume.getVolumeId());
|
||||
}
|
||||
activeLoopDevices.remove(volume.getVolumeId());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -416,7 +454,12 @@ public class Ec2VolumeBlockDeviceManager implements ContainerTeardown, Resettabl
|
||||
for (VolumeAttachment att : attachments) {
|
||||
Optional<Volume> volumeOpt = volumeLookup.apply(att.getVolumeId());
|
||||
if (volumeOpt.isPresent()) {
|
||||
attachVolume(volumeOpt.get(), instance, att.getDevice());
|
||||
try {
|
||||
attachVolume(volumeOpt.get(), instance, att.getDevice());
|
||||
} catch (AwsException e) {
|
||||
LOG.warnv("Could not restore volume {0} on instance {1}: {2}",
|
||||
att.getVolumeId(), instance.getInstanceId(), e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,6 +147,7 @@ import static org.mockito.Mockito.atLeast;
|
||||
import static org.mockito.Mockito.atLeastOnce;
|
||||
import static org.mockito.Mockito.clearInvocations;
|
||||
import static org.mockito.Mockito.doAnswer;
|
||||
import static org.mockito.Mockito.doReturn;
|
||||
import static org.mockito.Mockito.doThrow;
|
||||
import static org.mockito.Mockito.inOrder;
|
||||
import static org.mockito.Mockito.mock;
|
||||
@@ -6913,6 +6914,145 @@ class Ec2ServiceTest {
|
||||
assertFalse(attached.getAttachments().getFirst().isDeleteOnTermination());
|
||||
}
|
||||
|
||||
private static VolumeAttachmentFixture volumeAttachmentFixture() {
|
||||
Ec2VolumeBlockDeviceManager blockDevices = mock(Ec2VolumeBlockDeviceManager.class);
|
||||
Ec2Service service = new Ec2Service(mockConfig(true), mock(Ec2ContainerManager.class),
|
||||
mock(Ec2PortForwardManager.class), mock(AmiImageResolver.class), mock(Ec2ImageCatalog.class),
|
||||
new Ec2InstanceTypeCatalog(), new InMemoryStorageFactory(), null, null, blockDevices);
|
||||
Instance instance = service.runInstances("us-east-1", "ami-1234567890abcdef0", "t3.micro",
|
||||
1, 1, null, List.of(), null, null, List.of(), null, null).getInstances().getFirst();
|
||||
instance.setState(InstanceState.running());
|
||||
Volume volume = service.createVolume("us-east-1", instance.getPlacement().getAvailabilityZone(), "gp3", 1,
|
||||
false, 0, null, null, List.of());
|
||||
return new VolumeAttachmentFixture(blockDevices, service, instance, volume);
|
||||
}
|
||||
|
||||
private record VolumeAttachmentFixture(Ec2VolumeBlockDeviceManager blockDevices, Ec2Service service,
|
||||
Instance instance, Volume volume) {
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(booleans = {true, false})
|
||||
void attachmentExceptionsLeaveStoredVolumeAvailableAndRetryable(boolean awsError) {
|
||||
VolumeAttachmentFixture fixture = volumeAttachmentFixture();
|
||||
Ec2VolumeBlockDeviceManager blockDevices = fixture.blockDevices();
|
||||
Ec2Service service = fixture.service();
|
||||
Instance instance = fixture.instance();
|
||||
Volume volume = fixture.volume();
|
||||
RuntimeException failure = awsError ? new AwsException("InternalError", "attachment failed", 500)
|
||||
: new IllegalStateException("unexpected backend failure");
|
||||
when(blockDevices.attachVolume(any(), any(), anyString())).thenThrow(failure);
|
||||
|
||||
assertThrows(RuntimeException.class, () -> service.attachVolume("us-east-1", volume.getVolumeId(),
|
||||
instance.getInstanceId(), "/dev/xvdf"));
|
||||
Volume stored = service.describeVolumes("us-east-1", List.of(volume.getVolumeId()), Map.of()).getFirst();
|
||||
assertEquals("available", stored.getState());
|
||||
assertTrue(stored.getAttachments().isEmpty());
|
||||
|
||||
doReturn(Optional.of("/dev/xvdf")).when(blockDevices).attachVolume(any(), any(), anyString());
|
||||
assertEquals("attached", service.attachVolume("us-east-1", volume.getVolumeId(),
|
||||
instance.getInstanceId(), "/dev/xvdf").getState());
|
||||
when(blockDevices.attachVolume(any(), any(), anyString()))
|
||||
.thenThrow(new AwsException("InternalError", "restoration failed", 500));
|
||||
assertDoesNotThrow(() -> service.restoreAttachedVolumesForInstance("us-east-1", instance));
|
||||
assertEquals("in-use", stored.getState());
|
||||
assertEquals(1, stored.getAttachments().size());
|
||||
}
|
||||
|
||||
@Test
|
||||
void concurrentAttachmentWaitsForThePhysicalOperation() throws Exception {
|
||||
VolumeAttachmentFixture fixture = volumeAttachmentFixture();
|
||||
Ec2VolumeBlockDeviceManager blockDevices = fixture.blockDevices();
|
||||
Ec2Service service = fixture.service();
|
||||
Instance instance = fixture.instance();
|
||||
Volume volume = fixture.volume();
|
||||
CountDownLatch attaching = new CountDownLatch(1);
|
||||
CountDownLatch release = new CountDownLatch(1);
|
||||
when(blockDevices.attachVolume(any(), any(), anyString())).thenAnswer(invocation -> {
|
||||
attaching.countDown();
|
||||
assertTrue(release.await(10, TimeUnit.SECONDS));
|
||||
return Optional.of("/dev/xvdf");
|
||||
});
|
||||
try (ExecutorService executor = Executors.newVirtualThreadPerTaskExecutor()) {
|
||||
Future<VolumeAttachment> first = executor.submit(() -> service.attachVolume("us-east-1",
|
||||
volume.getVolumeId(), instance.getInstanceId(), "/dev/xvdf"));
|
||||
try {
|
||||
assertTrue(attaching.await(10, TimeUnit.SECONDS));
|
||||
AtomicReference<Thread> contender = new AtomicReference<>();
|
||||
Future<AwsException> second = executor.submit(() -> {
|
||||
contender.set(Thread.currentThread());
|
||||
return assertThrows(AwsException.class, () -> service.attachVolume("us-east-1",
|
||||
volume.getVolumeId(), instance.getInstanceId(), "/dev/xvdg"));
|
||||
});
|
||||
awaitBlockedOrDone(contender, second);
|
||||
assertFalse(second.isDone(), "second attachment must wait for the physical operation");
|
||||
release.countDown();
|
||||
assertEquals("attached", first.get(10, TimeUnit.SECONDS).getState());
|
||||
assertEquals("VolumeInUse", second.get(10, TimeUnit.SECONDS).getErrorCode());
|
||||
verify(blockDevices).attachVolume(volume, instance, "/dev/xvdf");
|
||||
verify(blockDevices, never()).attachVolume(volume, instance, "/dev/xvdg");
|
||||
} finally {
|
||||
release.countDown();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(booleans = {true, false})
|
||||
void differentVolumesCannotClaimTheSameDeviceDuringPhysicalAttachment(boolean firstFails) throws Exception {
|
||||
VolumeAttachmentFixture fixture = volumeAttachmentFixture();
|
||||
Ec2VolumeBlockDeviceManager blockDevices = fixture.blockDevices();
|
||||
Ec2Service service = fixture.service();
|
||||
Instance instance = fixture.instance();
|
||||
Volume firstVolume = fixture.volume();
|
||||
String zone = instance.getPlacement().getAvailabilityZone();
|
||||
Volume secondVolume = service.createVolume("us-east-1", zone, "gp3", 1,
|
||||
false, 0, null, null, List.of());
|
||||
CountDownLatch attaching = new CountDownLatch(1);
|
||||
CountDownLatch release = new CountDownLatch(1);
|
||||
when(blockDevices.attachVolume(eq(firstVolume), any(), anyString())).thenAnswer(invocation -> {
|
||||
attaching.countDown();
|
||||
assertTrue(release.await(10, TimeUnit.SECONDS));
|
||||
if (firstFails) {
|
||||
throw new AwsException("InternalError", "attachment failed", 500);
|
||||
}
|
||||
return Optional.of("/dev/xvdf");
|
||||
});
|
||||
try (ExecutorService executor = Executors.newVirtualThreadPerTaskExecutor()) {
|
||||
Future<?> first = executor.submit(() -> {
|
||||
if (firstFails) {
|
||||
return assertThrows(AwsException.class, () -> service.attachVolume("us-east-1",
|
||||
firstVolume.getVolumeId(), instance.getInstanceId(), "xvdf"));
|
||||
}
|
||||
return service.attachVolume("us-east-1", firstVolume.getVolumeId(), instance.getInstanceId(), "xvdf");
|
||||
});
|
||||
try {
|
||||
assertTrue(attaching.await(10, TimeUnit.SECONDS));
|
||||
Future<AwsException> second = executor.submit(() -> assertThrows(AwsException.class,
|
||||
() -> service.attachVolume("us-east-1", secondVolume.getVolumeId(),
|
||||
instance.getInstanceId(), "/dev/xvdf")));
|
||||
assertEquals("InvalidParameterValue", second.get(5, TimeUnit.SECONDS).getErrorCode());
|
||||
assertEquals("available", secondVolume.getState());
|
||||
assertTrue(secondVolume.getAttachments().isEmpty());
|
||||
verify(blockDevices, never()).attachVolume(eq(secondVolume), any(), anyString());
|
||||
release.countDown();
|
||||
first.get(10, TimeUnit.SECONDS);
|
||||
if (firstFails) {
|
||||
assertEquals("attached", service.attachVolume("us-east-1", secondVolume.getVolumeId(),
|
||||
instance.getInstanceId(), "/dev/xvdf").getState());
|
||||
assertEquals("available", firstVolume.getState());
|
||||
} else {
|
||||
AwsException error = assertThrows(AwsException.class, () -> service.attachVolume("us-east-1",
|
||||
secondVolume.getVolumeId(), instance.getInstanceId(), "/dev/xvdf"));
|
||||
assertEquals("InvalidParameterValue", error.getErrorCode());
|
||||
verify(blockDevices, never()).attachVolume(eq(secondVolume), any(), anyString());
|
||||
}
|
||||
} finally {
|
||||
release.countDown();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void attachVolumeThrowsWithDifferentAZ() {
|
||||
Ec2Service service = new Ec2Service(mockConfig(true), mock(Ec2ContainerManager.class),
|
||||
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
package io.floci.aws.services.ec2;
|
||||
|
||||
import io.floci.aws.core.common.AwsException;
|
||||
import io.floci.aws.testing.AwsTestClients;
|
||||
import io.quarkus.test.InjectMock;
|
||||
import io.quarkus.test.junit.QuarkusTest;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
import software.amazon.awssdk.regions.Region;
|
||||
import software.amazon.awssdk.services.ec2.Ec2Client;
|
||||
import software.amazon.awssdk.services.ec2.model.AttachVolumeResponse;
|
||||
import software.amazon.awssdk.services.ec2.model.Ec2Exception;
|
||||
import software.amazon.awssdk.services.ec2.model.Instance;
|
||||
import software.amazon.awssdk.services.ec2.model.Volume;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import static org.awaitility.Awaitility.await;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anyString;
|
||||
import static org.mockito.Mockito.doReturn;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
@QuarkusTest
|
||||
class Ec2VolumeAttachmentFailureIntegrationTest {
|
||||
|
||||
private static final AtomicLong ACCOUNTS = new AtomicLong(881100000000L);
|
||||
|
||||
@InjectMock
|
||||
Ec2VolumeBlockDeviceManager blockDevices;
|
||||
|
||||
@Test
|
||||
void failedAttachmentReturnsAnSdkErrorLeavesVolumeAvailableAndCanBeRetried() {
|
||||
when(blockDevices.attachVolume(any(), any(), anyString()))
|
||||
.thenThrow(new AwsException("InternalError", "Could not attach volume", 500));
|
||||
|
||||
try (Ec2Client client = client()) {
|
||||
Instance instance = launch(client);
|
||||
Volume volume = createVolume(client, instance);
|
||||
try {
|
||||
Ec2Exception error = assertThrows(Ec2Exception.class, () -> client.attachVolume(r -> r
|
||||
.volumeId(volume.volumeId()).instanceId(instance.instanceId()).device("/dev/xvdf")));
|
||||
assertEquals(500, error.statusCode());
|
||||
assertEquals("InternalError", error.awsErrorDetails().errorCode());
|
||||
Volume afterFailure = describeVolume(client, volume.volumeId());
|
||||
assertEquals("available", afterFailure.stateAsString());
|
||||
assertTrue(afterFailure.attachments().isEmpty());
|
||||
|
||||
doReturn(Optional.of("/dev/xvdf")).when(blockDevices).attachVolume(any(), any(), anyString());
|
||||
client.attachVolume(r -> r.volumeId(volume.volumeId()).instanceId(instance.instanceId())
|
||||
.device("/dev/xvdf"));
|
||||
assertEquals("in-use", describeVolume(client, volume.volumeId()).stateAsString());
|
||||
} finally {
|
||||
client.terminateInstances(r -> r.instanceIds(instance.instanceId()));
|
||||
client.deleteVolume(r -> r.volumeId(volume.volumeId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(booleans = {true, false})
|
||||
void physicalSuccessAndIntentionalSimulationKeepTheExistingSdkContract(boolean physical) {
|
||||
when(blockDevices.attachVolume(any(), any(), anyString()))
|
||||
.thenReturn(physical ? Optional.of("/dev/xvdf") : Optional.empty());
|
||||
|
||||
try (Ec2Client client = client()) {
|
||||
Instance instance = launch(client);
|
||||
Volume volume = createVolume(client, instance);
|
||||
try {
|
||||
AttachVolumeResponse response = client.attachVolume(r -> r.volumeId(volume.volumeId())
|
||||
.instanceId(instance.instanceId()).device("/dev/xvdf"));
|
||||
assertEquals("attaching", response.stateAsString());
|
||||
Volume attached = describeVolume(client, volume.volumeId());
|
||||
assertEquals("in-use", attached.stateAsString());
|
||||
assertEquals(1, attached.attachments().size());
|
||||
assertEquals("attached", attached.attachments().getFirst().stateAsString());
|
||||
assertEquals("/dev/xvdf", attached.attachments().getFirst().device());
|
||||
} finally {
|
||||
client.terminateInstances(r -> r.instanceIds(instance.instanceId()));
|
||||
client.deleteVolume(r -> r.volumeId(volume.volumeId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Ec2Client client() {
|
||||
return AwsTestClients.create(Ec2Client.builder().overrideConfiguration(c -> c
|
||||
.retryStrategy(s -> s.maxAttempts(1))), Long.toString(ACCOUNTS.incrementAndGet()), Region.US_EAST_1);
|
||||
}
|
||||
|
||||
private Instance launch(Ec2Client client) {
|
||||
Instance instance = client.runInstances(r -> r.imageId("ami-1234567890abcdef0").instanceType("t3.micro")
|
||||
.minCount(1).maxCount(1)).instances().getFirst();
|
||||
await().atMost(Duration.ofSeconds(10)).pollInterval(Duration.ofMillis(100)).untilAsserted(() ->
|
||||
assertEquals("running", client.describeInstances(r -> r.instanceIds(instance.instanceId()))
|
||||
.reservations().getFirst().instances().getFirst().state().nameAsString()));
|
||||
return instance;
|
||||
}
|
||||
|
||||
private Volume createVolume(Ec2Client client, Instance instance) {
|
||||
String volumeId = client.createVolume(r -> r.availabilityZone(instance.placement().availabilityZone())
|
||||
.size(1)).volumeId();
|
||||
return describeVolume(client, volumeId);
|
||||
}
|
||||
|
||||
private Volume describeVolume(Ec2Client client, String volumeId) {
|
||||
return client.describeVolumes(r -> r.volumeIds(volumeId)).volumes().getFirst();
|
||||
}
|
||||
}
|
||||
@@ -4,17 +4,30 @@ import com.github.dockerjava.api.DockerClient;
|
||||
import com.github.dockerjava.api.command.InspectContainerResponse;
|
||||
import com.github.dockerjava.api.exception.NotFoundException;
|
||||
import io.floci.aws.config.EmulatorConfig;
|
||||
import io.floci.aws.core.common.AwsException;
|
||||
import io.floci.aws.core.common.docker.ContainerBuilder;
|
||||
import io.floci.aws.core.common.docker.ContainerExecStubs;
|
||||
import io.floci.aws.core.common.docker.ContainerLifecycleManager;
|
||||
import io.floci.aws.services.ec2.model.Instance;
|
||||
import io.floci.aws.services.ec2.model.InstanceState;
|
||||
import io.floci.aws.services.ec2.model.Volume;
|
||||
import io.floci.aws.services.ec2.model.VolumeAttachment;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.io.TempDir;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anyInt;
|
||||
@@ -34,6 +47,7 @@ class Ec2VolumeBlockDeviceManagerTest {
|
||||
|
||||
private static final String HELPER_ID = "helper-container-id";
|
||||
|
||||
private EmulatorConfig config;
|
||||
private DockerClient dockerClient;
|
||||
private InspectContainerResponse helper;
|
||||
private ContainerLifecycleManager lifecycleManager;
|
||||
@@ -41,7 +55,7 @@ class Ec2VolumeBlockDeviceManagerTest {
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
EmulatorConfig config = mock(EmulatorConfig.class, RETURNS_DEEP_STUBS);
|
||||
config = mock(EmulatorConfig.class, RETURNS_DEEP_STUBS);
|
||||
when(config.services().ec2().volumeBlockDevices()).thenReturn(true);
|
||||
when(config.services().ec2().mock()).thenReturn(false);
|
||||
|
||||
@@ -56,6 +70,205 @@ class Ec2VolumeBlockDeviceManagerTest {
|
||||
lifecycleManager, config);
|
||||
}
|
||||
|
||||
@Test
|
||||
void attachVolumeCreatesTheDeviceBeforeReportingSuccess() {
|
||||
List<List<String>> helperCommands = ContainerExecStubs.completeEveryExec(dockerClient, HELPER_ID,
|
||||
0, "1 /dev/loop3", "");
|
||||
List<List<String>> targetCommands = ContainerExecStubs.completeEveryExec(dockerClient, "guest", 0, "", "");
|
||||
|
||||
assertEquals(Optional.of("/dev/xvdf"), manager.attachVolume(volume(), runningInstance(), "xvdf"));
|
||||
assertEquals(1, helperCommands.size());
|
||||
assertEquals(1, targetCommands.size());
|
||||
assertTrue(targetCommands.getFirst().get(2).endsWith("[ -b \"$dev\" ]"));
|
||||
assertEquals("/dev/xvdf", targetCommands.getFirst().get(4));
|
||||
}
|
||||
|
||||
@Test
|
||||
void loopAllocationFailureReturnsAnAwsErrorWithoutReleasingUnownedLoops() {
|
||||
List<List<String>> commands = ContainerExecStubs.completeEveryExec(dockerClient, HELPER_ID,
|
||||
List.of(1L, 0L), "", "permission denied");
|
||||
|
||||
AwsException error = assertThrows(AwsException.class,
|
||||
() -> manager.attachVolume(volume(), runningInstance(), "/dev/xvdf"));
|
||||
|
||||
assertEquals("InternalError", error.getErrorCode());
|
||||
assertEquals(500, error.getHttpStatus());
|
||||
assertFalse(error.getMessage().contains("permission denied"));
|
||||
assertEquals(1, commands.size());
|
||||
verify(dockerClient, never()).execCreateCmd("guest");
|
||||
}
|
||||
|
||||
@Test
|
||||
void guestDeviceFailureCleansUpAndAllowsRetry() {
|
||||
List<List<String>> helperCommands = ContainerExecStubs.completeEveryExec(dockerClient, HELPER_ID,
|
||||
0, "1 /dev/loop3", "");
|
||||
List<List<String>> targetCommands = ContainerExecStubs.completeEveryExec(dockerClient, "guest",
|
||||
List.of(1L, 0L, 0L), "", "");
|
||||
Instance instance = runningInstance();
|
||||
|
||||
assertThrows(AwsException.class, () -> manager.attachVolume(volume(), instance, "/dev/xvdf"));
|
||||
assertEquals(List.of("rm", "-f", "/dev/xvdf"), targetCommands.getLast());
|
||||
assertEquals(List.of("losetup", "-d", "/dev/loop3"), helperCommands.getLast());
|
||||
assertEquals(Optional.of("/dev/xvdf"), manager.attachVolume(volume(), instance, "/dev/xvdf"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void failedRestoreDoesNotReleaseTheReusedLoopAndCanBeRetried() {
|
||||
List<List<String>> helperCommands = ContainerExecStubs.completeEveryExec(dockerClient, HELPER_ID,
|
||||
0, "0 /dev/loop3", "");
|
||||
ContainerExecStubs.completeEveryExec(dockerClient, "guest", List.of(1L, 0L, 0L), "", "");
|
||||
Volume volume = volume();
|
||||
VolumeAttachment attachment = new VolumeAttachment();
|
||||
attachment.setVolumeId(volume.getVolumeId());
|
||||
attachment.setDevice("/dev/xvdf");
|
||||
attachment.setState("attached");
|
||||
volume.setState("in-use");
|
||||
volume.getAttachments().add(attachment);
|
||||
Instance instance = runningInstance();
|
||||
|
||||
assertDoesNotThrow(() -> manager.restoreInstanceVolumeDevices(instance, List.of(attachment),
|
||||
id -> Optional.of(volume)));
|
||||
|
||||
assertEquals(1, helperCommands.size(), "restoration must not detach a pre-existing loop");
|
||||
assertEquals("in-use", volume.getState());
|
||||
assertEquals("attached", attachment.getState());
|
||||
assertEquals(Optional.of("/dev/xvdf"), manager.attachVolume(volume, instance, "/dev/xvdf"));
|
||||
assertEquals(2, helperCommands.size());
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(booleans = {true, false})
|
||||
void helperReportsWhetherItAllocatedOrReusedTheLoop(boolean reused, @TempDir Path directory) throws Exception {
|
||||
List<List<String>> helperCommands = ContainerExecStubs.completeEveryExec(dockerClient, HELPER_ID,
|
||||
0, "1 /dev/loop3", "");
|
||||
ContainerExecStubs.completeEveryExec(dockerClient, "guest", 0, "", "");
|
||||
manager.attachVolume(volume(), runningInstance(), "/dev/xvdf");
|
||||
String script = helperCommands.getFirst().get(2);
|
||||
String fakeCommands = "losetup() {\n"
|
||||
+ " case \"$1\" in\n"
|
||||
+ " -j) " + (reused ? "echo \"/dev/loop3: 0 $2\"" : ":") + ";;\n"
|
||||
+ " -f) echo /dev/loop3;;\n"
|
||||
+ " /dev/loop3) :;;\n"
|
||||
+ " *) return 1;;\n"
|
||||
+ " esac\n"
|
||||
+ "}\n"
|
||||
+ "mknod() { :; }\n";
|
||||
Path rawFile = Files.createFile(directory.resolve("volume.raw"));
|
||||
int exitCode = HelperShellFixture.run(
|
||||
new String[]{"sh", "-c", fakeCommands + script, "helper", rawFile.toString(), "1"}, directory, Map.of());
|
||||
String output = HelperShellFixture.output(directory).trim();
|
||||
assertEquals(0, exitCode, output);
|
||||
assertEquals((reused ? "0" : "1") + " /dev/loop3", output);
|
||||
}
|
||||
|
||||
@Test
|
||||
void cleanupFailureStillReportsTheOriginalAttachmentError() {
|
||||
List<List<String>> helperCommands = ContainerExecStubs.completeEveryExec(dockerClient, HELPER_ID,
|
||||
List.of(0L, 1L), "1 /dev/loop3", "");
|
||||
ContainerExecStubs.completeEveryExec(dockerClient, "guest", 1, "", "permission denied");
|
||||
|
||||
AwsException error = assertThrows(AwsException.class,
|
||||
() -> manager.attachVolume(volume(), runningInstance(), "/dev/xvdf"));
|
||||
|
||||
assertEquals("InternalError", error.getErrorCode());
|
||||
assertEquals(2, helperCommands.size());
|
||||
assertEquals(List.of("losetup", "-d", "/dev/loop3"), helperCommands.getLast());
|
||||
}
|
||||
|
||||
@Test
|
||||
void mockModeRetainsMetadataOnlyTracking() {
|
||||
when(config.services().ec2().mock()).thenReturn(true);
|
||||
|
||||
assertEquals(Optional.empty(), manager.attachVolume(volume(), runningInstance(), "/dev/xvdf"));
|
||||
verify(dockerClient, never()).execCreateCmd(anyString());
|
||||
}
|
||||
|
||||
@Test
|
||||
void unexpectedLoopOutputFailsWithoutCreatingAGuestDevice() {
|
||||
ContainerExecStubs.completeEveryExec(dockerClient, HELPER_ID, 0, "not a loop device", "");
|
||||
|
||||
assertThrows(AwsException.class, () -> manager.attachVolume(volume(), runningInstance(), "/dev/xvdf"));
|
||||
verify(dockerClient, never()).execCreateCmd("guest");
|
||||
}
|
||||
|
||||
@Test
|
||||
void dockerExecExceptionFailsAttachment() {
|
||||
when(dockerClient.execCreateCmd(HELPER_ID)).thenThrow(new IllegalStateException("daemon went away"));
|
||||
|
||||
assertThrows(AwsException.class, () -> manager.attachVolume(volume(), runningInstance(), "/dev/xvdf"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void unavailableHelperFailsAttachment() {
|
||||
when(dockerClient.inspectContainerCmd(anyString()).exec()).thenThrow(new IllegalStateException("unavailable"));
|
||||
|
||||
assertThrows(AwsException.class, () -> manager.attachVolume(volume(), runningInstance(), "/dev/xvdf"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void disabledBlockDevicesRetainMetadataOnlyTracking() {
|
||||
when(config.services().ec2().volumeBlockDevices()).thenReturn(false);
|
||||
|
||||
assertEquals(Optional.empty(), manager.attachVolume(volume(), runningInstance(), "/dev/xvdf"));
|
||||
verify(dockerClient, never()).execCreateCmd(anyString());
|
||||
}
|
||||
|
||||
@Test
|
||||
void unavailableDockerRetainsMetadataOnlyTracking() {
|
||||
when(dockerClient.pingCmd().exec()).thenThrow(new IllegalStateException("unavailable"));
|
||||
|
||||
assertEquals(Optional.empty(), manager.attachVolume(volume(), runningInstance(), "/dev/xvdf"));
|
||||
verify(dockerClient, never()).execCreateCmd(anyString());
|
||||
}
|
||||
|
||||
@Test
|
||||
void stoppedInstanceDefersDeviceCreationEvenWhenContainerIsStillRunning() {
|
||||
Instance instance = runningInstance();
|
||||
instance.setState(InstanceState.stopped());
|
||||
|
||||
assertEquals(Optional.empty(), manager.attachVolume(volume(), instance, "/dev/xvdf"));
|
||||
verify(dockerClient, never()).execCreateCmd(anyString());
|
||||
}
|
||||
|
||||
@Test
|
||||
void missingOrStoppedContainerRetainsMetadataOnlyTracking() {
|
||||
Instance instance = runningInstance();
|
||||
when(lifecycleManager.isContainerRunning("guest")).thenReturn(false);
|
||||
assertEquals(Optional.empty(), manager.attachVolume(volume(), instance, "/dev/xvdf"));
|
||||
instance.setDockerContainerId(null);
|
||||
assertEquals(Optional.empty(), manager.attachVolume(volume(), instance, "/dev/xvdf"));
|
||||
verify(dockerClient, never()).execCreateCmd(anyString());
|
||||
}
|
||||
|
||||
@Test
|
||||
void restorationLogsAttachmentFailureAndKeepsExistingRecords() {
|
||||
ContainerExecStubs.completeEveryExec(dockerClient, HELPER_ID, 1, "", "permission denied");
|
||||
VolumeAttachment attachment = new VolumeAttachment();
|
||||
attachment.setVolumeId("vol-1");
|
||||
attachment.setDevice("/dev/xvdf");
|
||||
attachment.setState("attached");
|
||||
|
||||
assertDoesNotThrow(() -> manager.restoreInstanceVolumeDevices(runningInstance(), List.of(attachment),
|
||||
id -> Optional.of(volume())));
|
||||
assertEquals("attached", attachment.getState());
|
||||
}
|
||||
|
||||
private Instance runningInstance() {
|
||||
Instance instance = new Instance();
|
||||
instance.setInstanceId("i-1");
|
||||
instance.setState(InstanceState.running());
|
||||
instance.setDockerContainerId("guest");
|
||||
when(lifecycleManager.isContainerRunning("guest")).thenReturn(true);
|
||||
return instance;
|
||||
}
|
||||
|
||||
private Volume volume() {
|
||||
Volume volume = new Volume();
|
||||
volume.setVolumeId("vol-1");
|
||||
volume.setSize(1);
|
||||
return volume;
|
||||
}
|
||||
|
||||
@Test
|
||||
void stopManagedContainersReleasesLoopDevicesAndRemovesTheHelper() {
|
||||
List<List<String>> commands = ContainerExecStubs.completeEveryExec(dockerClient, HELPER_ID, 0, "", "");
|
||||
|
||||
Reference in new issue
Block a user