-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Improvements to the kubectl restart policy flag's input validation error log #121570
base: master
Are you sure you want to change the base?
Conversation
|
Welcome @slahirucd7! |
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
Hi @slahirucd7. 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/test-infra repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: slahirucd7 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@soltysh @ardaguclu |
Hi @deads2k, |
@pacoxu @ritazh @alexzielenski |
It sounds valid. Leave to sig cli maintainers. /cc @eddiezane |
@@ -544,7 +544,7 @@ func getRestartPolicy(cmd *cobra.Command, interactive bool) (corev1.RestartPolic | |||
case corev1.RestartPolicyNever: | |||
return corev1.RestartPolicyNever, nil | |||
} | |||
return "", cmdutil.UsageErrorf(cmd, "invalid restart policy: %s", restart) | |||
return "", cmdutil.UsageErrorf(cmd, "invalid restart policy: %s. Acceptable values are: %s, %s, %s.", restart, corev1.RestartPolicyAlways, corev1.RestartPolicyOnFailure, corev1.RestartPolicyNever) |
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.
Looks good to me. Could you please add a test case for checking the error message in here
package run |
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.
Ack. I'll update with a test case. Thanks for reviewing.
Hi @slahirucd7 Any updates on this? If you are not actively working on the PR you can close it. |
I'll add the relevant tests soon. |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
What type of PR is this?
Add one of the following kinds:
/kind bug
What this PR does / why we need it:
With kubectl commands we can provide the
--restart
flag values.Therefore we can run below command with the above mentioned flag.
kubectl run busybox --image=busybox --restart=never
But executing above command gives the error ->
error: invalid restart policy: never
Considering above executed this command ->
kubectl run busybox --image=busybox --restart=Never
It worked without any errors.
Which issue(s) this PR fixes:
Fixes #
kubernetes/kubectl#1504
Special notes for your reviewer:
After merging this PR error message will be ->
invalid restart policy: never. Acceptable values are: Always, OnFailure, Never
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: