mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
fix(ecs): round-trip command and entryPoint on container definitions (#2446)
RegisterTaskDefinition already parsed containerDefinitions[].command and .entryPoint, and EcsContainerManager honoured both when launching the container — but containerDefinitionNode never rendered them, so DescribeTaskDefinition silently omitted both keys. The practical consequence is data loss on the describe -> register round trip that tooling relies on to cut a new revision: the overrides disappear from the JSON and the new revision falls back to the image's default entrypoint. The container still starts, so nothing surfaces until whatever the entrypoint was meant to do turns out not to have happened. Serialize both sparsely, matching the surrounding portMappings / mountPoints style, so definitions that set neither stay byte-identical. Tests: a parse+serialize unit test in the EcsJsonHandlerVolumesTest style (round trip plus an absent-stays-absent guard), and an end-to-end register -> describe case in EcsIntegrationTest. Refs #2445
This commit is contained in:
1 parent
257e004600
commit
5c45c146c7
3 files changed
+172
No files matched your search
@@ -1035,6 +1035,18 @@ public class EcsJsonHandler {
|
||||
n.set("portMappings", pms);
|
||||
}
|
||||
|
||||
if (def.getEntryPoint() != null && !def.getEntryPoint().isEmpty()) {
|
||||
ArrayNode entryPoint = objectMapper.createArrayNode();
|
||||
def.getEntryPoint().forEach(entryPoint::add);
|
||||
n.set("entryPoint", entryPoint);
|
||||
}
|
||||
|
||||
if (def.getCommand() != null && !def.getCommand().isEmpty()) {
|
||||
ArrayNode command = objectMapper.createArrayNode();
|
||||
def.getCommand().forEach(command::add);
|
||||
n.set("command", command);
|
||||
}
|
||||
|
||||
if (def.getEnvironment() != null && !def.getEnvironment().isEmpty()) {
|
||||
ArrayNode envArr = objectMapper.createArrayNode();
|
||||
for (KeyValuePair kv : def.getEnvironment()) {
|
||||
|
||||
Reference in new issue
Block a user