Skip to content

armgit / floci

Public Imported from GitHub
0

Light, fluffy, and always free - The AWS Local Emulator alternative

fix(ecs): register persisted model records for native-image reflection (#1606)

Hector Ventura47e79b0ff5fe
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:
* <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). */