mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
Merge pull request #28626 from juanvallejo/update-resource-builder-format-error
Automatic merge from submit-queue update resource builder error message to be more clear release-note-none The error message given by command line `kubectl get` is sometimes of no help / not clear on what must be corrected, e.g.: `kubectl get pod pod/database-1-i10b9` error: when passing arguments in resource/name form, all arguments must include the resource ##### Steps to Reproduce: 1. Run command "$ kubectl get pod pod/database-1-i10b9" ##### Actual Result: Get unfriendly error message which is of no help: "error: when passing arguments in resource/name form, all arguments must include the resource" ##### Expected Result: Error message should recommend end user to run this cli in good grammar: "$ kubectl get pod database-1-i10b9" or "$ kubectl get pod/database-1-i10b9" ##### Before "error: when passing arguments in resource/name form, all arguments must include the resource" ##### After "error: there is no need to specify a resource type as a separate argument when passing arguments in resource/name form (e.g. `kubectl get resource/<resource_name>` instead of `kubectl get resource resource/<resource_name>`" []()
This commit is contained in:
@@ -1231,7 +1231,7 @@ func TestHasNames(t *testing.T) {
|
||||
{
|
||||
args: []string{"rc/foo", "bar"},
|
||||
expectedHasName: false,
|
||||
expectedError: fmt.Errorf("when passing arguments in resource/name form, all arguments must include the resource"),
|
||||
expectedError: fmt.Errorf("there is no need to specify a resource type as a separate argument when passing arguments in resource/name form (e.g. 'resource.test get resource/<resource_name>' instead of 'resource.test get resource resource/<resource_name>'"),
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
|
||||
Reference in New Issue
Block a user