Skip to content

Commit

Permalink
chore: refactor where CUSTOM gets added to possible AMI types
Browse files Browse the repository at this point in the history
  • Loading branch information
Artemigos committed Aug 12, 2024
1 parent 37adee8 commit 432ead4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-eks/lib/managed-nodegroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ export class Nodegroup extends Resource implements INodegroup {
* 1. instance types of different CPU architectures are not mixed(e.g. X86 with ARM).
* 2. user-specified amiType should be included in `possibleAmiTypes`.
*/
possibleAmiTypes = getPossibleAmiTypes(instanceTypes).concat(NodegroupAmiType.CUSTOM);
possibleAmiTypes = getPossibleAmiTypes(instanceTypes);

// if the user explicitly configured an ami type, make sure it's included in the possibleAmiTypes
if (props.amiType && !possibleAmiTypes.includes(props.amiType)) {
Expand Down Expand Up @@ -662,5 +662,5 @@ function getPossibleAmiTypes(instanceTypes: InstanceType[]): NodegroupAmiType[]
throw new Error('instanceTypes of different architectures is not allowed');
}

return archAmiMap.get(Array.from(architectures)[0])!;
return archAmiMap.get(Array.from(architectures)[0])!.concat(NodegroupAmiType.CUSTOM);
}

0 comments on commit 432ead4

Please sign in to comment.