Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to delete the CRD resource #226

Open
unicorncrush opened this issue Aug 16, 2023 · 3 comments
Open

Unable to delete the CRD resource #226

unicorncrush opened this issue Aug 16, 2023 · 3 comments

Comments

@unicorncrush
Copy link

Uploading image.png…
CRD created resources cannot be deleted
./blade destroy cpu-load --target k8s --kubeconfig config {"code":54000,"success":false,"error":"destory experiment failed, cannot get the chaos_os program","result":{"uid":"cpu-load","success":false,"error":"destory experiment failed, cannot get the chaos_os program","statuses":[{"id":"2fbdd6067914c6a4","state":"Error","error":"destory experiment failed, cannot get the chaos_os program","success":false,"kind":"node","identifier":"/iz0jlgcp5drhbu6a8thwmfz/"}]}}
kubectl delete chaosblades.chaosblade.io container-cpu-0

How to reproduce it (as minimally and precisely as possible)

  1. Create CRD resources,Container CPU injection failed. Procedure
  2. Query Document Modify DS-mountPath: /host-sys -- > -mountPath: /sys
  3. Container CPU injection successful, found destruction experiment

Tell us your environment

chaosblade-operator-1.7.1.tgz
containerd+k8s
cri-containerd-cni-1.7.3+ k8s v1.27.4

@unicorncrush
Copy link
Author

image

@MandssS
Copy link
Contributor

MandssS commented Aug 17, 2023

you can try: blades=($(kubectl get blade | grep -v NAME | awk '{print $1}' | tr '\n' ' ')) && kubectl patch blade $blades --type merge -p '{"metadata":{"finalizers":[]}}'

@spencercjh
Copy link
Contributor

spencercjh commented Apr 7, 2024

Here you are.

refer to https://gist.github.com/xoanmi/5e12e0b3f90d1a62a721a2b3ba4122ed

RESOURCES=$(kubectl get blade --no-headers -o name -n $YOUR_NAMESPACE --kubeconfig $YOUR_KUBECONFIG)
for n in $RESOURCES
do
  kubectl patch $n \
    --type json \
    --patch='[ { "op": "remove", "path": "/metadata/finalizers" } ]'
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants