From 91eb56f4aa321c2a396704da34e51ece9c44c13d Mon Sep 17 00:00:00 2001 From: Marcello Romani Date: Tue, 15 Jan 2019 11:11:24 +0000 Subject: [PATCH] Fix zsh-specific syntax in retry loop within null_resource.update_config_map_aws_auth (#245) * Fixed zsh-specific syntax, fail if kubectl apply fails after 10 attempts * Updated CHANGELOG --- CHANGELOG.md | 8 ++++++-- aws_auth.tf | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9572d78..bcaad79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,10 +8,14 @@ project adheres to [Semantic Versioning](http://semver.org/). ## [[v2.0.1](https://github.com/terraform-aws-modules/terraform-aws-eks/compare/v2.0.0...HEAD)] - 2019-01-??] ### Added - - Write your awesome addition here (by @you) + +- Write your awesome addition here (by @you) ### Changed - - Removed invalid action from worker_autoscaling iam policy + +- Removed invalid action from worker_autoscaling iam policy (by @marcelloromani) +- Fixed zsh-specific syntax in retry loop for aws auth config map (by @marcelloromani) +- Fix: fail deployment if applying the aws auth config map still fails after 10 attempts (by @marcelloromani) ## [[v2.0.0](https://github.com/terraform-aws-modules/terraform-aws-eks/compare/v1.8.0...v2.0.0)] - 2018-12-14] diff --git a/aws_auth.tf b/aws_auth.tf index 70312ae..e7af046 100644 --- a/aws_auth.tf +++ b/aws_auth.tf @@ -8,7 +8,7 @@ resource "null_resource" "update_config_map_aws_auth" { depends_on = ["aws_eks_cluster.this"] provisioner "local-exec" { - command = "for i in {1..5}; do kubectl apply -f ${var.config_output_path}config-map-aws-auth_${var.cluster_name}.yaml --kubeconfig ${var.config_output_path}kubeconfig_${var.cluster_name} && break || sleep 10; done" + command = "for i in `seq 1 10`; do kubectl apply -f ${var.config_output_path}config-map-aws-auth_${var.cluster_name}.yaml --kubeconfig ${var.config_output_path}kubeconfig_${var.cluster_name} && exit 0 || sleep 10; done; exit 1" interpreter = ["${var.local_exec_interpreter}"] }