diff --git a/cameleer-server-app/src/main/java/com/cameleer/server/app/storage/PostgresDeploymentRepository.java b/cameleer-server-app/src/main/java/com/cameleer/server/app/storage/PostgresDeploymentRepository.java index 91aa4c0a..1715e008 100644 --- a/cameleer-server-app/src/main/java/com/cameleer/server/app/storage/PostgresDeploymentRepository.java +++ b/cameleer-server-app/src/main/java/com/cameleer/server/app/storage/PostgresDeploymentRepository.java @@ -172,6 +172,7 @@ public class PostgresDeploymentRepository implements DeploymentRepository { rs.getString("container_name"), rs.getString("error_message"), resolvedConfig, + null, // deployedConfigSnapshot — wired in Task 1.4 deployedAt != null ? deployedAt.toInstant() : null, stoppedAt != null ? stoppedAt.toInstant() : null, rs.getTimestamp("created_at").toInstant() diff --git a/cameleer-server-app/src/test/java/com/cameleer/server/app/alerting/eval/DeploymentStateEvaluatorTest.java b/cameleer-server-app/src/test/java/com/cameleer/server/app/alerting/eval/DeploymentStateEvaluatorTest.java index 5f345ffa..06424525 100644 --- a/cameleer-server-app/src/test/java/com/cameleer/server/app/alerting/eval/DeploymentStateEvaluatorTest.java +++ b/cameleer-server-app/src/test/java/com/cameleer/server/app/alerting/eval/DeploymentStateEvaluatorTest.java @@ -48,7 +48,7 @@ class DeploymentStateEvaluatorTest { private Deployment deployment(DeploymentStatus status) { return new Deployment(DEP_ID, APP_ID, UUID.randomUUID(), ENV_ID, status, null, null, List.of(), null, null, "orders-0", null, - Map.of(), NOW.minusSeconds(60), null, NOW.minusSeconds(120)); + Map.of(), null, NOW.minusSeconds(60), null, NOW.minusSeconds(120)); } @Test diff --git a/cameleer-server-core/src/main/java/com/cameleer/server/core/runtime/Deployment.java b/cameleer-server-core/src/main/java/com/cameleer/server/core/runtime/Deployment.java index d4153c68..374262d7 100644 --- a/cameleer-server-core/src/main/java/com/cameleer/server/core/runtime/Deployment.java +++ b/cameleer-server-core/src/main/java/com/cameleer/server/core/runtime/Deployment.java @@ -19,6 +19,7 @@ public record Deployment( String containerName, String errorMessage, Map resolvedConfig, + DeploymentConfigSnapshot deployedConfigSnapshot, Instant deployedAt, Instant stoppedAt, Instant createdAt @@ -27,6 +28,13 @@ public record Deployment( return new Deployment(id, appId, appVersionId, environmentId, newStatus, targetState, deploymentStrategy, replicaStates, deployStage, containerId, containerName, errorMessage, resolvedConfig, - deployedAt, stoppedAt, createdAt); + deployedConfigSnapshot, deployedAt, stoppedAt, createdAt); + } + + public Deployment withDeployedConfigSnapshot(DeploymentConfigSnapshot snapshot) { + return new Deployment(id, appId, appVersionId, environmentId, status, + targetState, deploymentStrategy, replicaStates, deployStage, + containerId, containerName, errorMessage, resolvedConfig, + snapshot, deployedAt, stoppedAt, createdAt); } }