feat: add labels support to StartContainerRequest and DockerRuntimeOrchestrator

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-04 20:55:16 +02:00
parent b0275bcf64
commit d25849d665
3 changed files with 6 additions and 2 deletions

View File

@@ -140,7 +140,8 @@ public class DeploymentService {
),
runtimeConfig.parseMemoryLimitBytes(),
runtimeConfig.getContainerCpuShares(),
runtimeConfig.getAgentHealthPort()
runtimeConfig.getAgentHealthPort(),
Map.of()
));
deployment.setOrchestratorMetadata(Map.of("containerId", containerId));

View File

@@ -21,6 +21,7 @@ import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@Component
@@ -87,6 +88,7 @@ public class DockerRuntimeOrchestrator implements RuntimeOrchestrator {
var container = dockerClient.createContainerCmd(request.imageRef())
.withName(request.containerName())
.withEnv(envList)
.withLabels(request.labels() != null ? request.labels() : Map.of())
.withHostConfig(hostConfig)
.withHealthcheck(new HealthCheck()
.withTest(List.of("CMD-SHELL",

View File

@@ -9,5 +9,6 @@ public record StartContainerRequest(
Map<String, String> envVars,
long memoryLimitBytes,
int cpuShares,
int healthCheckPort
int healthCheckPort,
Map<String, String> labels
) {}