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
kubectl: improve the warning message when doing kubectl apply to the resource without expected annotation #91934
Conversation
@SataQiu: GitHub didn't allow me to request PR reviews from the following users: 007g3m1n1. Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
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/test-infra repository. |
d3e8f9d
to
b83ecdf
Compare
/retest |
1 similar comment
/retest |
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.
One nit and you're good to go.
@@ -132,7 +132,7 @@ var ( | |||
# Apply the configuration in manifest.yaml and delete all the other configmaps that are not in the file. | |||
kubectl apply --prune -f manifest.yaml --all --prune-whitelist=core/v1/ConfigMap`)) | |||
|
|||
warningNoLastAppliedConfigAnnotation = "Warning: %[1]s apply should be used on resource created by either %[1]s create --save-config or %[1]s apply\n" | |||
warningNoLastAppliedConfigAnnotation = "Warning: resource %[1]s is missing the necessary annotation which required by %[2]s apply, it maybe not created by either %[2]s create --save-config or %[2]s apply, the missing annotation will be patched automatically\n" |
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.
which is required
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 a lot @soltysh
Done!
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: SataQiu, soltysh 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 |
b83ecdf
to
d1f8fdd
Compare
/retest |
1 similar comment
/retest |
As someone who has seen this error message and been confused, I would say this new message has confusing English and raises more questions!
May I suggest something more like:
A reference to imperative/declarative resource creation is helpful here - it makes the problem much easier to Google. |
…resource without expected annotation Signed-off-by: SataQiu <1527062125@qq.com>
d1f8fdd
to
9c163f0
Compare
@ThomWright Thank you for your suggestions, updated! |
/assign @liggitt |
looks like @soltysh has review on this one /unassign |
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.
/lgtm
/priority important-soon |
/retest |
/retest Review the full test history for this PR. Silence the bot with an |
3 similar comments
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
kubectl: improve the warning message when doing kubectl apply to the resource without expected annotation.
Users are keeping complaining about the confusing warning message
Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply
:Which issue(s) this PR fixes:
Fixes #91425
Ref: #82154 #36620 #36672
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
/cc @007g3m1n1