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.
This commit is contained in:
Hector Ventura authored and GitHub committed 2026-06-26 23:34:24 -05:00
1 parent 68fc4134c4
commit 47e79b0ff5
6 files changed
+18

No files matched your search

@@ -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,
@@ -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) {
}
@@ -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) {
}
@@ -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) {
}
@@ -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) {
@@ -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:
* <ul>
@@ -11,6 +13,7 @@ package io.github.hectorvent.floci.services.ecs.model;
* The two are mutually exclusive. A container references the volume by {@code name} via a
* {@link MountPoint}.
*/
@RegisterForReflection
public record Volume(String name, String hostSourcePath, EfsVolumeConfiguration efs) {
/** Convenience constructor for a {@code host} volume (no EFS configuration). */