Skip to content

Commit

Permalink
fix(eks): cannot customize alb controller repository and version (#18081
Browse files Browse the repository at this point in the history
)

Close #18054

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
kirintwn committed Dec 19, 2021
1 parent bdd91cb commit e4256c8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
9 changes: 5 additions & 4 deletions packages/@aws-cdk/aws-eks/lib/alb-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,10 @@ export class AlbController extends CoreConstruct {
},
region: Stack.of(this).region,
vpcId: props.cluster.vpc.vpcId,
repository: props.repository ?? '602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-load-balancer-controller',
tag: props.version.version,
image: {
repository: props.repository ?? '602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-load-balancer-controller',
tag: props.version.version,
},
},
});

Expand All @@ -243,5 +245,4 @@ export class AlbController extends CoreConstruct {
chart.node.addDependency(props.cluster.openIdConnectProvider);
chart.node.addDependency(props.cluster.awsAuth);
}

}
}
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-eks/test/alb-controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ test('can configure a custom repository', () => {
{
Ref: 'ClusterDefaultVpcFA9F2722',
},
'","repository":"custom","tag":"v2.3.0"}',
'","image":{"repository":"custom","tag":"v2.3.0"}}',
],
],
},
Expand All @@ -74,4 +74,4 @@ test('throws when a policy is not defined for a custom version', () => {
version: AlbControllerVersion.of('custom'),
})).toThrowError("'albControllerOptions.policy' is required when using a custom controller version");

});
});
Original file line number Diff line number Diff line change
Expand Up @@ -1678,7 +1678,7 @@
{
"Ref": "Vpc8378EB38"
},
"\",\"repository\":\"602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-load-balancer-controller\",\"tag\":\"v2.3.0\"}"
"\",\"image\":{\"repository\":\"602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-load-balancer-controller\",\"tag\":\"v2.3.0\"}}"
]
]
},
Expand Down Expand Up @@ -2348,4 +2348,4 @@
"Description": "Artifact hash for asset \"06035c90bda92ff37322a329e214af5f2a1e591c6920e0cea4c6816e0f38ac4b\""
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2043,7 +2043,7 @@
{
"Ref": "Vpc8378EB38"
},
"\",\"repository\":\"602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-load-balancer-controller\",\"tag\":\"v2.3.0\"}"
"\",\"image\":{\"repository\":\"602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-load-balancer-controller\",\"tag\":\"v2.3.0\"}}"
]
]
},
Expand Down Expand Up @@ -2421,4 +2421,4 @@
"Default": "/aws/service/eks/optimized-ami/1.21/amazon-linux-2-gpu/recommended/image_id"
}
}
}
}

0 comments on commit e4256c8

Please sign in to comment.