Skip to content

Commit 145ef97

Browse files
committed
fix: ip/vpc are not deleted by helm uninstall
Signed-off-by: Mengxin Liu <[email protected]>
1 parent 5fdcffd commit 145ef97

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

charts/kube-ovn-v2/templates/hooks/pre-delete-hook.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ spec:
113113
command:
114114
- sh
115115
- -c
116-
- /kube-ovn/remove-subnet-finalizer.sh 2>&1 | tee -a /var/log/kube-ovn/remove-subnet-finalizer.log
116+
- /kube-ovn/remove-finalizer.sh 2>&1 | tee -a /var/log/kube-ovn/remove-finalizer.log
117117
volumeMounts:
118118
- mountPath: /var/log/kube-ovn
119119
name: kube-ovn-log

charts/kube-ovn/templates/pre-delete-hook.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ spec:
113113
command:
114114
- sh
115115
- -c
116-
- /kube-ovn/remove-subnet-finalizer.sh 2>&1 | tee -a /var/log/kube-ovn/remove-subnet-finalizer.log
116+
- /kube-ovn/remove-finalizer.sh 2>&1 | tee -a /var/log/kube-ovn/remove-finalizer.log
117117
volumeMounts:
118118
- mountPath: /var/log/kube-ovn
119119
name: kube-ovn-log

dist/images/remove-finalizer.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
for subnet in $(kubectl get subnet -o name); do
6+
kubectl patch "$subnet" --type='json' -p '[{"op": "replace", "path": "/metadata/finalizers", "value": []}]'
7+
done
8+
9+
for vpc in $(kubectl get vpc -o name); do
10+
kubectl patch "$vpc" --type='json' -p '[{"op": "replace", "path": "/metadata/finalizers", "value": []}]'
11+
done
12+
13+
for ip in $(kubectl get ip -o name); do
14+
kubectl patch "$ip" --type='json' -p '[{"op": "replace", "path": "/metadata/finalizers", "value": []}]'
15+
done

dist/images/remove-subnet-finalizer.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)