Skip to content

Commit

Permalink
Merge pull request #14 from edenlabllc/release/v1.24.0
Browse files Browse the repository at this point in the history
Release/v1.24.0
  • Loading branch information
anovikov-el authored Oct 29, 2024
2 parents f602dab + e588f5c commit 96fcdfe
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 10 deletions.
50 changes: 50 additions & 0 deletions bin/aws-cluster-postsync-hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env bash

set -e

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

GO_TEMPLATE='
{{- range .items -}}
{{- if eq .kind "Cluster" -}}
{{- if ne .status.phase "Provisioned" }}0{{- end }}
{{- if not .status.controlPlaneReady }}0{{- end }}
{{- if not .status.infrastructureReady }}0{{- end }}
{{- end -}}
{{- if eq .kind "AWSManagedCluster" -}}
{{- if not .status.ready }}0{{- end }}
{{- end -}}
{{- if eq .kind "AWSManagedControlPlane" -}}
{{- if not .status.ready }}0{{- end }}
{{- if not .status.initialized }}0{{- end }}
{{- end -}}
{{- if eq .kind "AWSManagedMachinePool" -}}
{{- if not .status.ready }}0{{- end -}}
{{- end -}}
{{- if eq .kind "MachinePool" -}}
{{- if ne .status.phase "Running" }}0{{- end }}
{{- if not .status.bootstrapReady }}0{{- end }}
{{- if not .status.infrastructureReady }}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
9 changes: 9 additions & 0 deletions bin/aws-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}"
7 changes: 7 additions & 0 deletions bin/azure-cluster-postsync-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ GO_TEMPLATE='
{{- range .items -}}
{{- if eq .kind "Cluster" -}}
{{- if ne .status.phase "Provisioned" }}0{{- end }}
{{- if not .status.controlPlaneReady }}0{{- end }}
{{- if not .status.infrastructureReady }}0{{- end }}
{{- end -}}
{{- if eq .kind "AzureManagedCluster" -}}
{{- if not .status.ready }}0{{- end }}
Expand All @@ -21,6 +23,11 @@ GO_TEMPLATE='
{{- if eq .kind "AzureManagedMachinePool" -}}
{{- if not .status.ready }}0{{- end -}}
{{- end -}}
{{- if eq .kind "MachinePool" -}}
{{- if ne .status.phase "Running" }}0{{- end }}
{{- if not .status.bootstrapReady }}0{{- end }}
{{- if not .status.infrastructureReady }}0{{- end }}
{{- end -}}
{{- end -}}
'

Expand Down
10 changes: 0 additions & 10 deletions bin/azure-cluster-presync-hook.sh

This file was deleted.

0 comments on commit 96fcdfe

Please sign in to comment.