fix: move network attachment from orchestrator to executor
All checks were successful
CI / cleanup-branch (push) Has been skipped
CI / build (push) Successful in 1m29s
CI / docker (push) Successful in 1m10s
CI / deploy-feature (push) Has been skipped
CI / deploy (push) Successful in 36s

Docker's connectToNetworkCmd needs the network ID (not name) and the
container's network sandbox must be ready. Moving network connection
to DeploymentExecutor where DockerNetworkManager handles ID resolution
and the container is already started.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-08 21:29:13 +02:00
parent c72424543e
commit c923d8233b
2 changed files with 5 additions and 9 deletions

View File

@@ -135,6 +135,11 @@ public class DeploymentExecutor {
String containerId = orchestrator.startContainer(request);
newContainerIds.add(containerId);
// Connect to environment network after container is started
if (networkManager != null && envNet != null) {
networkManager.connectContainer(containerId, envNet);
}
replicaStates.add(Map.of(
"index", i,
"containerId", containerId,

View File

@@ -100,15 +100,6 @@ public class DockerRuntimeOrchestrator implements RuntimeOrchestrator {
var container = createCmd.exec();
dockerClient.startContainerCmd(container.getId()).exec();
if (request.additionalNetworks() != null) {
for (String net : request.additionalNetworks()) {
dockerClient.connectToNetworkCmd()
.withContainerId(container.getId())
.withNetworkId(net)
.exec();
}
}
log.info("Started container {} ({})", request.containerName(), container.getId());
return container.getId();
}