Remove use of deprecated IsErr...NotFound checks
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@ -54,7 +54,7 @@ func runInspect(dockerCli command.Cli, opts inspectOptions) error {
|
||||
getRef := func(ref string) (interface{}, []byte, error) {
|
||||
// Service inspect shows defaults values in empty fields.
|
||||
service, _, err := client.ServiceInspectWithRaw(ctx, ref, types.ServiceInspectOptions{InsertDefaults: true})
|
||||
if err == nil || !apiclient.IsErrServiceNotFound(err) {
|
||||
if err == nil || !apiclient.IsErrNotFound(err) {
|
||||
return service, nil, err
|
||||
}
|
||||
return nil, nil, errors.Errorf("Error: no such service: %s", ref)
|
||||
@ -62,7 +62,7 @@ func runInspect(dockerCli command.Cli, opts inspectOptions) error {
|
||||
|
||||
getNetwork := func(ref string) (interface{}, []byte, error) {
|
||||
network, _, err := client.NetworkInspectWithRaw(ctx, ref, types.NetworkInspectOptions{Scope: "swarm"})
|
||||
if err == nil || !apiclient.IsErrNetworkNotFound(err) {
|
||||
if err == nil || !apiclient.IsErrNotFound(err) {
|
||||
return network, nil, err
|
||||
}
|
||||
return nil, nil, errors.Errorf("Error: no such network: %s", ref)
|
||||
|
||||
@ -102,7 +102,7 @@ func runLogs(dockerCli *command.DockerCli, opts *logsOptions) error {
|
||||
}
|
||||
task, _, err := cli.TaskInspectWithRaw(ctx, opts.target)
|
||||
if err != nil {
|
||||
if client.IsErrTaskNotFound(err) {
|
||||
if client.IsErrNotFound(err) {
|
||||
// if the task isn't found, rewrite the error to be clear
|
||||
// that we looked for services AND tasks and found none
|
||||
err = fmt.Errorf("no such task or service: %v", opts.target)
|
||||
|
||||
Reference in New Issue
Block a user