kyverno / chainsaw

Declarative K8s e2e testing
https://kyverno.github.io/chainsaw/
Apache License 2.0
280 stars 42 forks source link

[Question] Wait for deletion fail if not exist, how to skip the error #1831

Open nkuacac opened 1 month ago

nkuacac commented 1 month ago

Describe your question

| 13:23:14 | superkruise.virtualcluster.sample.001 | step-2   | CMD       | RUN   |
    === COMMAND
    /usr/local/bin/kubectl wait virtualclusters.v1alpha1.clusters.superkruise.io --for=delete virtual-cluster-001 -n chainsaw-ultimate-viper -o yaml --timeout 1m0s
| 13:23:14 | superkruise.virtualcluster.sample.001 | step-2   | CMD       | LOG   |
    === STDERR
    Error from server (NotFound): virtualclusters.clusters.superkruise.io "virtual-cluster-001" not found
| 13:23:14 | superkruise.virtualcluster.sample.001 | step-2   | CMD       | ERROR |
    === ERROR
    exit status 1

chainsaw version Version

v0.2.7

Additional context

No response

eddycharly commented 1 month ago

Hey, thanks for reporting. Is there an option in kubectl to ignore not found ?

nkuacac commented 1 month ago

Hey, thanks for reporting. Is there an option in kubectl to ignore not found ?

Thanks for reply. kubectl don't have this option. My method is kubectl wait vc virtual-cluster-001 --for=delete -n chainsaw-ultimate-viper -o yaml --timeout 1m0s 2>&1 |grep -v 'timed out'