fix(ecs): emit empty arrays for empty mountPoints and volumesFrom (#9015)

* fix(ecs): emit empty arrays for empty mountPoints and volumesFrom
* test(ecs): an omitted volumesFrom reads back as [] too
This commit is contained in:
Matheus Oliveira authored and GitHub committed 2026-11-19 18:37:38 -04:00
1 parent c1e7b240ea
commit dca36665b5
3 files changed
+52 -4

No files matched your search

@@ -295,7 +295,7 @@ public class EcsResponseWriter {
if (def.getSecrets() != null && !def.getSecrets().isEmpty()) {
n.set("secrets", secretsNode(def.getSecrets()));
}
if (def.getMountPoints() != null && !def.getMountPoints().isEmpty()) {
if (def.getMountPoints() != null) {
ArrayNode mps = objectMapper.createArrayNode();
for (MountPoint mp : def.getMountPoints()) {
ObjectNode mpNode = objectMapper.createObjectNode();
@@ -306,7 +306,7 @@ public class EcsResponseWriter {
}
n.set("mountPoints", mps);
}
if (def.getVolumesFrom() != null && !def.getVolumesFrom().isEmpty()) {
if (def.getVolumesFrom() != null) {
ArrayNode volumesFrom = objectMapper.createArrayNode();
for (VolumeFrom volumeFrom : def.getVolumesFrom()) {
ObjectNode volumeFromNode = objectMapper.createObjectNode();