-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend ecs.TaskDefinition containerDefinitions normalization (#4126)
Fixes #1738 Fixes #1985 containerDefinitions expects a raw JSON which may lead to spurious diff on insignificant changes. The was pre-existing code for normalizing environment variable order and default values. This code is patched to extend it to handle normalizing the default value of healthCheck.timeout=5. --------- Co-authored-by: Florian Stadler <[email protected]>
- Loading branch information
1 parent
706903b
commit 896ae14
Showing
2 changed files
with
175 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
patches/0061-Normalize-ecs.TaskDefinition-containerDefinitions-he.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Anton Tayanovskyy <[email protected]> | ||
Date: Thu, 27 Jun 2024 16:20:44 -0400 | ||
Subject: [PATCH] Normalize ecs.TaskDefinition containerDefinitions | ||
healthCheck.timeout | ||
|
||
|
||
diff --git a/internal/service/ecs/task_definition_equivalency.go b/internal/service/ecs/task_definition_equivalency.go | ||
index 3d757997b5..efd649fbdc 100644 | ||
--- a/internal/service/ecs/task_definition_equivalency.go | ||
+++ b/internal/service/ecs/task_definition_equivalency.go | ||
@@ -72,6 +72,10 @@ func (cd containerDefinitions) Reduce(isAWSVPC bool) error { | ||
if def.Essential == nil { | ||
def.Essential = aws.Bool(true) | ||
} | ||
+ if def.HealthCheck != nil && def.HealthCheck.Timeout == nil { | ||
+ five := int64(5) | ||
+ def.HealthCheck.Timeout = &five | ||
+ } | ||
for j, pm := range def.PortMappings { | ||
if pm.Protocol != nil && aws.StringValue(pm.Protocol) == "tcp" { | ||
cd[i].PortMappings[j].Protocol = nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters