Skip to content

Commit

Permalink
Merge branch 'main' into huijbers/coverage-txt
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] committed Aug 25, 2023
2 parents 90e414c + 6cffca0 commit 10328e0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ export class CfnParser {
case 'Delete': return CfnDeletionPolicy.DELETE;
case 'Retain': return CfnDeletionPolicy.RETAIN;
case 'Snapshot': return CfnDeletionPolicy.SNAPSHOT;
case 'RetainExceptOnCreate': return CfnDeletionPolicy.RETAIN_EXCEPT_ON_CREATE;
default: throw new Error(`Unrecognized DeletionPolicy '${policy}'`);
}
}
Expand Down
3 changes: 2 additions & 1 deletion packages/aws-cdk/lib/api/hotswap/ecs-services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ export async function isHotswappableEcsServiceChange(
},
},
} as const;
const excludeFromTransformLowercased = transformObjectKeys(excludeFromTransform, lowerCaseFirstCharacter);
// We first uppercase the task definition to properly merge it with the one from CloudFormation template.
const upperCasedTaskDef = transformObjectKeys(target.taskDefinition, upperCaseFirstCharacter, excludeFromTransform);
const upperCasedTaskDef = transformObjectKeys(target.taskDefinition, upperCaseFirstCharacter, excludeFromTransformLowercased);
// merge evaluatable diff from CloudFormation template.
const updatedTaskDef = applyPropertyUpdates(changes.updates, upperCasedTaskDef);
// lowercase the merged task definition to use it in AWS SDK.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -812,13 +812,22 @@ describe.each([HotswapMode.FALL_BACK, HotswapMode.HOTSWAP_ONLY])('%p mode', (hot
});
});

test('should call registerTaskDefinition with certain properties not lowercased', async () => {
test('should call registerTaskDefinition with certain properties not lowercased nor uppercased', async () => {
// GIVEN
setupCurrentTaskDefinition({
taskDefinitionProperties: {
Family: 'my-task-def',
ContainerDefinitions: [
{ Image: 'image1' },
{
Image: 'image1',
DockerLabels: { Label1: 'label1' },
FirelensConfiguration: {
Options: { Name: 'cloudwatch' },
},
LogConfiguration: {
Options: { Option1: 'option1', option2: 'option2' },
},
},
],
Volumes: [
{
Expand Down Expand Up @@ -846,7 +855,7 @@ describe.each([HotswapMode.FALL_BACK, HotswapMode.HOTSWAP_ONLY])('%p mode', (hot
Options: { Name: 'cloudwatch' },
},
LogConfiguration: {
Options: { Option1: 'option1' },
Options: { Option1: 'option1', option2: 'option2' },
},
},
],
Expand Down Expand Up @@ -887,7 +896,7 @@ describe.each([HotswapMode.FALL_BACK, HotswapMode.HOTSWAP_ONLY])('%p mode', (hot
},
},
logConfiguration: {
options: { Option1: 'option1' },
options: { Option1: 'option1', option2: 'option2' },
},
},
],
Expand Down

0 comments on commit 10328e0

Please sign in to comment.