From 47e79b0ff5fefb7e4546c33ccd53af8c104cd425 Mon Sep 17 00:00:00 2001 From: Hector Ventura Date: Fri, 26 Jun 2026 23:34:24 -0500 Subject: [PATCH] fix(ecs): register persisted model records for native-image reflection (#1606) The ECS model records PortMapping, KeyValuePair, MountPoint, Volume, EfsVolumeConfiguration and NetworkBinding lacked @RegisterForReflection, so the native image could not Jackson-serialize task definitions to persistent storage ("No serializer found ... no properties discovered") when flushing ecs-task-definitions.json. The persisted ECS classes were already registered; these nested records were missed. Works under the JVM; fails only in the native image. --- .../floci/services/ecs/model/EfsVolumeConfiguration.java | 3 +++ .../hectorvent/floci/services/ecs/model/KeyValuePair.java | 3 +++ .../github/hectorvent/floci/services/ecs/model/MountPoint.java | 3 +++ .../hectorvent/floci/services/ecs/model/NetworkBinding.java | 3 +++ .../hectorvent/floci/services/ecs/model/PortMapping.java | 3 +++ .../io/github/hectorvent/floci/services/ecs/model/Volume.java | 3 +++ 6 files changed, 18 insertions(+) diff --git a/src/main/java/io/github/hectorvent/floci/services/ecs/model/EfsVolumeConfiguration.java b/src/main/java/io/github/hectorvent/floci/services/ecs/model/EfsVolumeConfiguration.java index aca8cdf45e..e4788306ea 100644 --- a/src/main/java/io/github/hectorvent/floci/services/ecs/model/EfsVolumeConfiguration.java +++ b/src/main/java/io/github/hectorvent/floci/services/ecs/model/EfsVolumeConfiguration.java @@ -1,5 +1,7 @@ package io.github.hectorvent.floci.services.ecs.model; +import io.quarkus.runtime.annotations.RegisterForReflection; + /** * The {@code efsVolumeConfiguration} of an ECS task-definition volume: * {@code {"fileSystemId": ..., "rootDirectory": ..., "transitEncryption": ..., @@ -15,6 +17,7 @@ package io.github.hectorvent.floci.services.ecs.model; * {@code authorizationConfig} are modelled for RegisterTaskDefinition/DescribeTaskDefinition * round-trip fidelity (so Terraform sees no drift) but have no effect on the local mount. */ +@RegisterForReflection public record EfsVolumeConfiguration( String fileSystemId, String rootDirectory, diff --git a/src/main/java/io/github/hectorvent/floci/services/ecs/model/KeyValuePair.java b/src/main/java/io/github/hectorvent/floci/services/ecs/model/KeyValuePair.java index 44425c99a7..4052fea987 100644 --- a/src/main/java/io/github/hectorvent/floci/services/ecs/model/KeyValuePair.java +++ b/src/main/java/io/github/hectorvent/floci/services/ecs/model/KeyValuePair.java @@ -1,4 +1,7 @@ package io.github.hectorvent.floci.services.ecs.model; +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection public record KeyValuePair(String name, String value) { } \ No newline at end of file diff --git a/src/main/java/io/github/hectorvent/floci/services/ecs/model/MountPoint.java b/src/main/java/io/github/hectorvent/floci/services/ecs/model/MountPoint.java index c9f1a804f3..ba442c664b 100644 --- a/src/main/java/io/github/hectorvent/floci/services/ecs/model/MountPoint.java +++ b/src/main/java/io/github/hectorvent/floci/services/ecs/model/MountPoint.java @@ -1,10 +1,13 @@ package io.github.hectorvent.floci.services.ecs.model; +import io.quarkus.runtime.annotations.RegisterForReflection; + /** * A container mount point in an ECS container definition: * {@code {"sourceVolume": ..., "containerPath": ..., "readOnly": ...}}. * {@code sourceVolume} references a task-level {@link Volume} by name; the volume's * host source path is bind-mounted into the container at {@code containerPath}. */ +@RegisterForReflection public record MountPoint(String sourceVolume, String containerPath, boolean readOnly) { } diff --git a/src/main/java/io/github/hectorvent/floci/services/ecs/model/NetworkBinding.java b/src/main/java/io/github/hectorvent/floci/services/ecs/model/NetworkBinding.java index ff11244df1..9ea45d3153 100644 --- a/src/main/java/io/github/hectorvent/floci/services/ecs/model/NetworkBinding.java +++ b/src/main/java/io/github/hectorvent/floci/services/ecs/model/NetworkBinding.java @@ -1,4 +1,7 @@ package io.github.hectorvent.floci.services.ecs.model; +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection public record NetworkBinding(String bindIP, int containerPort, int hostPort, String protocol) { } diff --git a/src/main/java/io/github/hectorvent/floci/services/ecs/model/PortMapping.java b/src/main/java/io/github/hectorvent/floci/services/ecs/model/PortMapping.java index 0a609e519c..7b3eb2863c 100644 --- a/src/main/java/io/github/hectorvent/floci/services/ecs/model/PortMapping.java +++ b/src/main/java/io/github/hectorvent/floci/services/ecs/model/PortMapping.java @@ -1,5 +1,8 @@ package io.github.hectorvent.floci.services.ecs.model; +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection public record PortMapping(int containerPort, int hostPort, String protocol) { public PortMapping(int containerPort) { diff --git a/src/main/java/io/github/hectorvent/floci/services/ecs/model/Volume.java b/src/main/java/io/github/hectorvent/floci/services/ecs/model/Volume.java index 37085df92b..9b56a49bef 100644 --- a/src/main/java/io/github/hectorvent/floci/services/ecs/model/Volume.java +++ b/src/main/java/io/github/hectorvent/floci/services/ecs/model/Volume.java @@ -1,5 +1,7 @@ package io.github.hectorvent.floci.services.ecs.model; +import io.quarkus.runtime.annotations.RegisterForReflection; + /** * A task-level volume in an ECS task definition. Two shapes are modelled: *