mirror of
				https://github.com/moby/moby.git
				synced 2022-11-09 12:21:53 -05:00 
			
		
		
		
	Replace uses of deprecated IsErr...Notfound()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
		
							parent
							
								
									a8e7aca3fd
								
							
						
					
					
						commit
						919726b5db
					
				
					 8 changed files with 9 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -62,7 +62,7 @@ func TestCheckpointListContainerNotFound(t *testing.T) {
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	_, err := client.CheckpointList(context.Background(), "unknown", types.CheckpointListOptions{})
 | 
			
		||||
	if err == nil || !IsErrContainerNotFound(err) {
 | 
			
		||||
	if err == nil || !IsErrNotFound(err) {
 | 
			
		||||
		t.Fatalf("expected a containerNotFound error, got %v", err)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -42,7 +42,7 @@ func TestConfigInspectConfigNotFound(t *testing.T) {
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	_, _, err := client.ConfigInspectWithRaw(context.Background(), "unknown")
 | 
			
		||||
	if err == nil || !IsErrConfigNotFound(err) {
 | 
			
		||||
	if err == nil || !IsErrNotFound(err) {
 | 
			
		||||
		t.Fatalf("expected a configNotFoundError error, got %v", err)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -53,7 +53,7 @@ func TestConfigInspect(t *testing.T) {
 | 
			
		|||
		version: "1.30",
 | 
			
		||||
		client: newMockClient(func(req *http.Request) (*http.Response, error) {
 | 
			
		||||
			if !strings.HasPrefix(req.URL.Path, expectedURL) {
 | 
			
		||||
				return nil, fmt.Errorf("Expected URL '%s', got '%s'", expectedURL, req.URL)
 | 
			
		||||
				return nil, fmt.Errorf("expected URL '%s', got '%s'", expectedURL, req.URL)
 | 
			
		||||
			}
 | 
			
		||||
			content, err := json.Marshal(swarm.Config{
 | 
			
		||||
				ID: "config_id",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -37,7 +37,7 @@ func TestContainerCreateImageNotFound(t *testing.T) {
 | 
			
		|||
		client: newMockClient(errorMock(http.StatusNotFound, "No such image")),
 | 
			
		||||
	}
 | 
			
		||||
	_, err := client.ContainerCreate(context.Background(), &container.Config{Image: "unknown_image"}, nil, nil, "unknown")
 | 
			
		||||
	if err == nil || !IsErrImageNotFound(err) {
 | 
			
		||||
	if err == nil || !IsErrNotFound(err) {
 | 
			
		||||
		t.Fatalf("expected an imageNotFound error, got %v", err)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -30,7 +30,7 @@ func TestContainerInspectContainerNotFound(t *testing.T) {
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	_, err := client.ContainerInspect(context.Background(), "unknown")
 | 
			
		||||
	if err == nil || !IsErrContainerNotFound(err) {
 | 
			
		||||
	if err == nil || !IsErrNotFound(err) {
 | 
			
		||||
		t.Fatalf("expected a containerNotFound error, got %v", err)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -31,7 +31,7 @@ func TestImageInspectImageNotFound(t *testing.T) {
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	_, _, err := client.ImageInspectWithRaw(context.Background(), "unknown")
 | 
			
		||||
	if err == nil || !IsErrImageNotFound(err) {
 | 
			
		||||
	if err == nil || !IsErrNotFound(err) {
 | 
			
		||||
		t.Fatalf("expected an imageNotFound error, got %v", err)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -30,7 +30,7 @@ func TestNodeInspectNodeNotFound(t *testing.T) {
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	_, _, err := client.NodeInspectWithRaw(context.Background(), "unknown")
 | 
			
		||||
	if err == nil || !IsErrNodeNotFound(err) {
 | 
			
		||||
	if err == nil || !IsErrNotFound(err) {
 | 
			
		||||
		t.Fatalf("expected a nodeNotFoundError error, got %v", err)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -42,7 +42,7 @@ func TestSecretInspectSecretNotFound(t *testing.T) {
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	_, _, err := client.SecretInspectWithRaw(context.Background(), "unknown")
 | 
			
		||||
	if err == nil || !IsErrSecretNotFound(err) {
 | 
			
		||||
	if err == nil || !IsErrNotFound(err) {
 | 
			
		||||
		t.Fatalf("expected a secretNotFoundError error, got %v", err)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -31,7 +31,7 @@ func TestServiceInspectServiceNotFound(t *testing.T) {
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	_, _, err := client.ServiceInspectWithRaw(context.Background(), "unknown", types.ServiceInspectOptions{})
 | 
			
		||||
	if err == nil || !IsErrServiceNotFound(err) {
 | 
			
		||||
	if err == nil || !IsErrNotFound(err) {
 | 
			
		||||
		t.Fatalf("expected a serviceNotFoundError error, got %v", err)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue