mirror of
				https://github.com/moby/moby.git
				synced 2022-11-09 12:21:53 -05:00 
			
		
		
		
	Add support for volume scopes
This is similar to network scopes where a volume can either be `local` or `global`. A `global` volume is one that exists across the entire cluster where as a `local` volume exists on a single engine. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
		
							parent
							
								
									79ff6eaf21
								
							
						
					
					
						commit
						2f40b1b281
					
				
					 13 changed files with 242 additions and 23 deletions
				
			
		| 
						 | 
				
			
			@ -2,7 +2,10 @@
 | 
			
		|||
 | 
			
		||||
package volumedrivers
 | 
			
		||||
 | 
			
		||||
import "errors"
 | 
			
		||||
import (
 | 
			
		||||
	"errors"
 | 
			
		||||
	"github.com/docker/docker/volume"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type client interface {
 | 
			
		||||
	Call(string, interface{}, interface{}) error
 | 
			
		||||
| 
						 | 
				
			
			@ -209,3 +212,30 @@ func (pp *volumeDriverProxy) Get(name string) (volume *proxyVolume, err error) {
 | 
			
		|||
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type volumeDriverProxyCapabilitiesRequest struct {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type volumeDriverProxyCapabilitiesResponse struct {
 | 
			
		||||
	Capabilities volume.Capability
 | 
			
		||||
	Err          string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (pp *volumeDriverProxy) Capabilities() (capabilities volume.Capability, err error) {
 | 
			
		||||
	var (
 | 
			
		||||
		req volumeDriverProxyCapabilitiesRequest
 | 
			
		||||
		ret volumeDriverProxyCapabilitiesResponse
 | 
			
		||||
	)
 | 
			
		||||
 | 
			
		||||
	if err = pp.Call("VolumeDriver.Capabilities", req, &ret); err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	capabilities = ret.Capabilities
 | 
			
		||||
 | 
			
		||||
	if ret.Err != "" {
 | 
			
		||||
		err = errors.New(ret.Err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue