In order to enforce strict handling of snapshotter values on the container object, the defaults have been moved to the client side. This ensures that we correctly qualify the snapshotter under use when from the container at the time it was created, rather than possibly losing the metadata on a change of default. Signed-off-by: Stephen J Day <stephen.day@docker.com>
		
			
				
	
	
		
			34 lines
		
	
	
		
			668 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			668 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package containerd
 | 
						|
 | 
						|
import (
 | 
						|
	"context"
 | 
						|
	"runtime"
 | 
						|
	"testing"
 | 
						|
 | 
						|
	"github.com/containerd/containerd/snapshot"
 | 
						|
	"github.com/containerd/containerd/snapshot/testsuite"
 | 
						|
)
 | 
						|
 | 
						|
func newSnapshotter(ctx context.Context, root string) (snapshot.Snapshotter, func(), error) {
 | 
						|
	client, err := New(address)
 | 
						|
	if err != nil {
 | 
						|
		return nil, nil, err
 | 
						|
	}
 | 
						|
 | 
						|
	sn := client.SnapshotService(DefaultSnapshotter)
 | 
						|
 | 
						|
	return sn, func() {
 | 
						|
		client.Close()
 | 
						|
	}, nil
 | 
						|
}
 | 
						|
 | 
						|
func TestSnapshotterClient(t *testing.T) {
 | 
						|
	if testing.Short() {
 | 
						|
		t.Skip()
 | 
						|
	}
 | 
						|
	if runtime.GOOS == "windows" {
 | 
						|
		t.Skip("snapshots not yet supported on Windows")
 | 
						|
	}
 | 
						|
	testsuite.SnapshotterSuite(t, "SnapshotterClient", newSnapshotter)
 | 
						|
}
 |