File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,12 +51,25 @@ spec:
5151 - |
5252 set -eu
5353 echo "Deleting KafkaTopics for {{ .Release.Name }} before the topic-operator is removed"
54- kubectl -n {{ .Release.Namespace }} delete kafkatopics.kafka.strimzi.io \
55- -l 'strimzi.io/cluster={{ .Release.Name }}' \
56- --ignore-not-found=true \
57- --wait=true \
58- --timeout=180s \
59- --request-timeout=20s
54+ if ! out=$(kubectl -n {{ .Release.Namespace }} delete kafkatopics.kafka.strimzi.io \
55+ -l 'strimzi.io/cluster={{ .Release.Name }}' \
56+ --ignore-not-found=true \
57+ --wait=true \
58+ --timeout=180s \
59+ --request-timeout=20s 2>&1); then
60+ printf '%s\n' "${out}"
61+ case "${out}" in
62+ *"the server doesn't have a resource type"*|*"no matches for kind"*)
63+ echo "KafkaTopic CRD absent; nothing to delete" ;;
64+ *"timed out waiting for the condition"*)
65+ echo "WARNING: topics still hold the strimzi.io/topic-operator finalizer after 180s." >&2
66+ echo "WARNING: leaving them behind so the uninstall can finish; clear the finalizer by hand." >&2 ;;
67+ *)
68+ echo "ERROR: deleting KafkaTopics failed: ${out}" >&2; exit 1 ;;
69+ esac
70+ else
71+ printf '%s\n' "${out}"
72+ fi
6073 volumeMounts :
6174 - name : tmp
6275 mountPath : /tmp
Original file line number Diff line number Diff line change 11suite : Kafka pre-delete cleanup
22
33templates :
4- - templates/delete.yaml
4+ - templates/hooks/ delete.yaml
55
66release :
77 name : kafka-test
You can’t perform that action at this time.
0 commit comments