Skip to content

Commit b69c8fb

Browse files
knittingdevmax-rocket-internet
authored andcommitted
Run aws-auth Update Commands in Sequence and not Parallel (#592)
* Run aws-auth Update Commands in Sequence and not Parallel * Update changelog
1 parent 215dc84 commit b69c8fb

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ project adheres to [Semantic Versioning](http://semver.org/).
1616
### Changed
1717

1818
- Updated instance_profile_names and instance_profile_arns outputs to also consider launch template as well as asg (by @ankitwal)
19+
- Updated application of `aws-auth` configmap to create `kube_config.yaml` and `aws_auth_configmap.yaml` in sequence (and not parallel) to `kubectl apply` (by @knittingdev)
20+
- Exit with error code when `aws-auth` configmap is unable to be updated (by @knittingdev)
1921
- Fix deprecated interpolation-only expression (by @angelabad)
2022
- Fix broken terraform plan/apply on a cluster < 1.14 (by @hodduc)
2123

aws_auth.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@ resource "null_resource" "update_config_map_aws_auth" {
1212
working_dir = path.module
1313

1414
command = <<EOS
15+
completed_apply=0
1516
for i in `seq 1 10`; do \
16-
echo "${null_resource.update_config_map_aws_auth[0].triggers.kube_config_map_rendered}" > kube_config.yaml & \
17-
echo "${null_resource.update_config_map_aws_auth[0].triggers.config_map_rendered}" > aws_auth_configmap.yaml & \
18-
kubectl apply -f aws_auth_configmap.yaml --kubeconfig kube_config.yaml && break || \
17+
echo "${null_resource.update_config_map_aws_auth[0].triggers.kube_config_map_rendered}" > kube_config.yaml && \
18+
echo "${null_resource.update_config_map_aws_auth[0].triggers.config_map_rendered}" > aws_auth_configmap.yaml && \
19+
kubectl apply -f aws_auth_configmap.yaml --kubeconfig kube_config.yaml && \
20+
completed_apply=1 && break || \
1921
sleep 10; \
2022
done; \
2123
rm aws_auth_configmap.yaml kube_config.yaml;
24+
if [ "$completed_apply" = "0" ]; then exit 1; fi;
2225
EOS
2326

2427

0 commit comments

Comments
 (0)