If the image fails to be pulled, whether the pvc created before should be delete
drummerglen opened this issue · 3 comments
In my lab, the kubestr image pull failed. I notice the pvc didn't delete automatically.
So if the image fails to be pulled, whether the pvc created before should be delete.
Thank you.
@drummerglen Thanks for opening this issue. I think I was able to reproduce the problem; looks like the only way for kubestr
to detect runtime errors like image pull failures is to wait for the context
to expire. Since the cleanup code shares the same context
with the K8s API calls code, the cleanup step would fail because the context
has expired by then. Does this match what you saw?
$ kubestr csicheck -i quay.io/isim/noexist:latest -s ebs-csi -v ebs-csi
Creating application
Cleaning up resources
Error deleteing PVC (kubestr-csi-original-pvcgxrmd) - (context deadline exceeded)
Error deleteing Pod (kubestr-csi-original-pod74std) - (context deadline exceeded)
CSI checker test:
Pod failed to become ready: Pod did not transition into running state. Timeout:15m0s Namespace:default, Name:kubestr-csi-original-pod74std: rate: Wait(n=1) would exceed context deadline - Error
Error: Pod failed to become ready: Pod did not transition into running state. Timeout:15m0s Namespace:default, Name:kubestr-csi-original-pod74std: rate: Wait(n=1) would exceed context deadline
I think an easy fix will be to use a different context with a reset timeout value for the cleanup step.
Will you be interested in helping us with a PR? That will help to speed up the fix.