Skip to content

Commit 864115f

Browse files
authored
Merge pull request #50 from edenlabllc/releases/v1.34.0
Releases/v1.34.0
2 parents 18936a4 + b547ed7 commit 864115f

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
RELEASE_NAME="${1}"
6+
NAMESPACE="${2:-capop-system}"
7+
LIMIT="${3:-3600}"
8+
9+
GO_TEMPLATE='
10+
{{- range .items -}}
11+
{{- if eq .kind "Cluster" -}}
12+
{{- if ne .status.phase "Provisioned" }}0{{- end }}
13+
{{- if not .status.controlPlaneReady }}0{{- end }}
14+
{{- if not .status.infrastructureReady }}0{{- end }}
15+
{{- end -}}
16+
{{- if eq .kind "K3SCluster" -}}
17+
{{- if ne .status.phase "Provisioned" }}0{{- end }}
18+
{{- if not .status.ready }}0{{- end }}
19+
{{- end -}}
20+
{{- if eq .kind "K3SControlPlane" -}}
21+
{{- if ne .status.phase "Provisioned" }}0{{- end }}
22+
{{- if not .status.ready }}0{{- end }}
23+
{{- if not .status.initialized }}0{{- end }}
24+
{{- end -}}
25+
{{- if eq .kind "K3SRemoteMachine" -}}
26+
{{- if ne .status.phase "Installed" }}0{{- end }}
27+
{{- if not .status.ready }}0{{- end -}}
28+
{{- end -}}
29+
{{- if eq .kind "Machine" -}}
30+
{{- if ne .status.phase "Running" }}0{{- end }}
31+
{{- if not .status.bootstrapReady }}0{{- end }}
32+
{{- if not .status.infrastructureReady }}0{{- end }}
33+
{{- end -}}
34+
{{- end -}}
35+
'
36+
37+
COUNT=1
38+
while true; do
39+
STATUS="$(kubectl --namespace "${NAMESPACE}" get cluster-api \
40+
--selector "app.kubernetes.io/instance=${RELEASE_NAME}" \
41+
--output "go-template=${GO_TEMPLATE}")"
42+
if [[ "${STATUS}" != "" && "${COUNT}" -le "${LIMIT}" ]]; then
43+
sleep 1
44+
((++COUNT))
45+
elif [[ "${COUNT}" -gt "${LIMIT}" ]]; then
46+
>2& echo "Limit exceeded."
47+
exit 1
48+
else
49+
echo
50+
kubectl --namespace "${NAMESPACE}" get cluster-api --selector "app.kubernetes.io/instance=${RELEASE_NAME}"
51+
break
52+
fi
53+
done
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
CLUSTER_NAME="${1}"
6+
NAMESPACE="${2:-capop-system}"
7+
WAIT_FOR_CLUSTER_DELETION="${3:-false}"
8+
9+
kubectl --namespace "${NAMESPACE}" delete cluster "${CLUSTER_NAME}" "--wait=${WAIT_FOR_CLUSTER_DELETION}"

0 commit comments

Comments
 (0)