mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #98749 from pandaamanda/kubectl_patch_error
fix kubectl patch command error message
This commit is contained in:
commit
6499f20d21
@ -839,7 +839,7 @@ func (b *Builder) visitorResult() *Result {
|
||||
return &Result{err: err}
|
||||
}
|
||||
}
|
||||
return &Result{err: fmt.Errorf("resource(s) were provided, but no name, label selector, or --all flag specified")}
|
||||
return &Result{err: fmt.Errorf("resource(s) were provided, but no name was specified")}
|
||||
}
|
||||
return &Result{err: missingResourceError}
|
||||
}
|
||||
|
@ -794,13 +794,13 @@ func TestResourceErrors(t *testing.T) {
|
||||
"resources but no selectors": {
|
||||
args: []string{"pods"},
|
||||
errFn: func(err error) bool {
|
||||
return strings.Contains(err.Error(), "resource(s) were provided, but no name, label selector, or --all flag specified")
|
||||
return strings.Contains(err.Error(), "resource(s) were provided, but no name was specified")
|
||||
},
|
||||
},
|
||||
"multiple resources but no selectors": {
|
||||
args: []string{"pods,deployments"},
|
||||
errFn: func(err error) bool {
|
||||
return strings.Contains(err.Error(), "resource(s) were provided, but no name, label selector, or --all flag specified")
|
||||
return strings.Contains(err.Error(), "resource(s) were provided, but no name was specified")
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -311,13 +311,13 @@ func TestLabelErrors(t *testing.T) {
|
||||
"resources but no selectors": {
|
||||
args: []string{"pods", "app=bar"},
|
||||
errFn: func(err error) bool {
|
||||
return strings.Contains(err.Error(), "resource(s) were provided, but no name, label selector, or --all flag specified")
|
||||
return strings.Contains(err.Error(), "resource(s) were provided, but no name was specified")
|
||||
},
|
||||
},
|
||||
"multiple resources but no selectors": {
|
||||
args: []string{"pods,deployments", "app=bar"},
|
||||
errFn: func(err error) bool {
|
||||
return strings.Contains(err.Error(), "resource(s) were provided, but no name, label selector, or --all flag specified")
|
||||
return strings.Contains(err.Error(), "resource(s) were provided, but no name was specified")
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user