Skip to content

Commit

Permalink
Merge pull request #2 from edenlabllc/release/v1.20.0
Browse files Browse the repository at this point in the history
Release/v1.20.0
  • Loading branch information
apanasiuk-el authored Jul 17, 2024
2 parents 78e87c3 + e7d4ad9 commit 8449450
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
44 changes: 44 additions & 0 deletions bin/azure-cluster-postsync-hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env bash

set -e

RELEASE_NAME="${1}"
NAMESPACE="${2:-azure}"

LIMIT=1200

GO_TEMPLATE='
{{- range .items -}}
{{- if eq .kind "Cluster" -}}
{{- if ne .status.phase "Provisioned" }}0{{- end }}
{{- end -}}
{{- if eq .kind "AzureManagedCluster" -}}
{{- if not .status.ready }}0{{- end }}
{{- end -}}
{{- if eq .kind "AzureManagedControlPlane" -}}
{{- if not .status.ready }}0{{- end }}
{{- if not .status.initialized }}0{{- end }}
{{- end -}}
{{- if eq .kind "AzureManagedMachinePool" -}}
{{- if not .status.ready }}0{{- end -}}
{{- end -}}
{{- end -}}
'

COUNT=1
while true; do
STATUS="$(kubectl --namespace "${NAMESPACE}" get cluster-api \
--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 cluster-api --selector "app.kubernetes.io/instance=${RELEASE_NAME}"
break
fi
done
10 changes: 10 additions & 0 deletions bin/azure-cluster-presync-hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -e

# Cluster-api settings
export EXP_AKS=true
export EXP_MACHINE_POOL=true
export EXP_CLUSTER_RESOURCE_SET=false

clusterctl init --infrastructure azure --wait-providers
9 changes: 9 additions & 0 deletions bin/azure-cluster-uninstall-hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -e

CLUSTER_NAME="${1}"
NAMESPACE="${2}"
WAIT_FOR_CLUSTER_DELETION="${3:-false}"

kubectl --namespace "${NAMESPACE}" delete cluster "${CLUSTER_NAME}" "--wait=${WAIT_FOR_CLUSTER_DELETION}"

0 comments on commit 8449450

Please sign in to comment.