Skip to content

Commit

Permalink
Merge pull request #7801 from guessi/reduce-error-output
Browse files Browse the repository at this point in the history
Reduce error output on "kubectl delete" by adding "--ignore-not-found"
  • Loading branch information
k8s-ci-robot authored Feb 13, 2025
2 parents aae2e8f + e2bba56 commit 43da9b6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 5 additions & 1 deletion vertical-pod-autoscaler/hack/vpa-process-yamls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ for i in $COMPONENTS; do
if [[ ${ACTION} == print ]]; then
${SCRIPT_ROOT}/hack/vpa-process-yaml.sh $(script_path $i)
else
${SCRIPT_ROOT}/hack/vpa-process-yaml.sh $(script_path $i) | kubectl ${ACTION} -f - || true
EXTRA_FLAGS=""
if [[ ${ACTION} == delete ]]; then
EXTRA_FLAGS+=" --ignore-not-found"
fi
${SCRIPT_ROOT}/hack/vpa-process-yaml.sh $(script_path $i) | kubectl ${ACTION} ${EXTRA_FLAGS} -f - || true
fi
done
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ set -e

echo "Unregistering VPA admission controller webhook"

kubectl delete -n kube-system mutatingwebhookconfiguration.v1.admissionregistration.k8s.io vpa-webhook-config

kubectl delete -n kube-system mutatingwebhookconfiguration.v1.admissionregistration.k8s.io vpa-webhook-config --ignore-not-found
4 changes: 2 additions & 2 deletions vertical-pod-autoscaler/pkg/admission-controller/rmcerts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
set -e

echo "Deleting VPA Admission Controller certs."
kubectl delete secret --namespace=kube-system vpa-tls-certs
kubectl delete secret --namespace=kube-system --ignore-not-found=true vpa-e2e-certs
kubectl delete secret --namespace=kube-system vpa-tls-certs --ignore-not-found
kubectl delete secret --namespace=kube-system vpa-e2e-certs --ignore-not-found

0 comments on commit 43da9b6

Please sign in to comment.