Skip to content

Commit

Permalink
Merge pull request #18 from edenlabllc/release/v1.26.0
Browse files Browse the repository at this point in the history
Release/v1.26.0
  • Loading branch information
anovikov-el authored Dec 12, 2024
2 parents 94058f1 + 2f5b2f1 commit 065350a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bin/aws-cluster-postsync-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

RELEASE_NAME="${1}"
NAMESPACE="${2:-aws}"
NAMESPACE="${2:-capa-system}"
LIMIT="${3:-1200}"

GO_TEMPLATE='
Expand Down
32 changes: 32 additions & 0 deletions bin/aws-iam-provision-postsync-hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bash

set -e

RELEASE_NAME="${1:-aws-iam-provision}"
NAMESPACE="${2:-capa-system}"
LIMIT="${3:-120}"

GO_TEMPLATE='
{{- range .items -}}
{{- if not .status }}0{{- end }}
{{- if ne .status.phase "Provisioned" }}0{{- end }}
{{- end -}}
'

COUNT=1
while true; do
STATUS="$(kubectl --namespace "${NAMESPACE}" get awsiamprovision \
--selector "app.kubernetes.io/instance=${RELEASE_NAME}" \
--output "go-template=${GO_TEMPLATE}")"
if [[ "${STATUS}" != "" && "${COUNT}" -le "${LIMIT}" ]]; then
sleep 1
((++COUNT))
elif [[ "${COUNT}" -gt "${LIMIT}" ]]; then
>2& echo "Limit exceeded."
exit 1
else
echo
kubectl --namespace "${NAMESPACE}" get awsiamprovision --selector "app.kubernetes.io/instance=${RELEASE_NAME}"
break
fi
done

0 comments on commit 065350a

Please sign in to comment.