-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Reduce error output on "kubectl delete" by adding "--ignore-not-found" #7801
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
Conversation
Hi @guessi. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After changed, it would still have some errors, but it's much lesser
% ./hack/vpa-down.sh
Deleting VPA Admission Controller certs.
Unregistering VPA admission controller webhook
Warning: deleting cluster-scoped resources, not scoped to the provided namespace
resource mapping not found for name: "verticalpodautoscalers.autoscaling.k8s.io" namespace: "" from "STDIN": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1beta1"
ensure CRDs are installed first
resource mapping not found for name: "verticalpodautoscalercheckpoints.autoscaling.k8s.io" namespace: "" from "STDIN": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1beta1"
ensure CRDs are installed first
the error here is simply because it try to do kubectl delete --ignore-not-found ./deploy/vpa-beta2-crd.yaml
but it contains apiVersion: apiextensions.k8s.io/v1beta1
which might not available to the cluster (depends on what k8s version it is running with).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1beta1" ...
could be easily cleaned by adding 2>/dev/null
but I'm not sure if it is what we expected?
/ok-to-test |
/remove-kind feature |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR. a tiny nit from my side.
aad5157
to
ae9d130
Compare
ae9d130
to
e2bba56
Compare
/lgtm |
Seems like a reasonable improvement, thanks! /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: guessi, raywainman The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind cleanup
/kind feature
What this PR does / why we need it:
While doing
./hack/vpa-down.sh
cleanup before deploy/re-deploy, there would have some error output as there's no resource to delete, by adding--ignore-not-found
could greatly reduce those unnecessary output.Which issue(s) this PR fixes:
Fixes n/a
Special notes for your reviewer:
Does this PR introduce a user-facing change?
NONE
For more information on release notes see: https://git.k8s.io/community/contributors/guide/release-notes.md
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: