storage/storage_reference.go
func (s storageReference) PolicyConfigurationNamespaces() []string {
	storeSpec := "[" + s.transport.store.GraphDriverName() + "@" + s.transport.store.GraphRoot() + "]"
	driverlessStoreSpec := "[" + s.transport.store.GraphRoot() + "]"
	namespaces := []string{}
	if s.named != nil {
		if s.id != "" {
			// The reference without the ID is also a valid namespace.
			namespaces = append(namespaces, storeSpec+s.named.String())
		}
		tagged, isTagged := s.named.(reference.Tagged)
		_, isDigested := s.named.(reference.Digested)
		if isTagged && isDigested { // s.named is "name:tag@digest"; add a "name:tag" parent namespace.
			namespaces = append(namespaces, storeSpec+s.named.Name()+":"+tagged.Tag())
		}
		components := strings.Split(s.named.Name(), "/")
		for len(components) > 0 {
			namespaces = append(namespaces, storeSpec+strings.Join(components, "/"))
			components = components[:len(components)-1]
		}
	}
	namespaces = append(namespaces, storeSpec)
	namespaces = append(namespaces, driverlessStoreSpec)
	return namespaces
}
func (s storageReference) PolicyConfigurationNamespaces() []string {
	storeSpec := "[" + s.transport.store.GraphDriverName() + "@" + s.transport.store.GraphRoot() + "]"
	driverlessStoreSpec := "[" + s.transport.store.GraphRoot() + "]"
	namespaces := []string{}
	if s.named != nil {
		if s.id != "" {
			// The reference without the ID is also a valid namespace.
			namespaces = append(namespaces, storeSpec+s.named.String())
		}
		tagged, isTagged := s.named.(reference.Tagged)
		_, isDigested := s.named.(reference.Digested)
		if isTagged && isDigested { // s.named is "name:tag@digest"; add a "name:tag" parent namespace.
			namespaces = append(namespaces, storeSpec+s.named.Name()+":"+tagged.Tag())
		}
		components := strings.Split(s.named.Name(), "/")
		for len(components) > 0 {
			namespaces = append(namespaces, storeSpec+strings.Join(components, "/"))
			components = components[:len(components)-1]
		}
	}
	namespaces = append(namespaces, storeSpec)
	namespaces = append(namespaces, driverlessStoreSpec)
	return namespaces
}
func ( s storageReference ) PolicyConfigurationNamespaces ( ) [ ] string { storeSpec := " " + s . transport . store . GraphDriverName ( ) + " " + s . transport . store . GraphRoot ( ) + " " driverlessStoreSpec := " " + s . transport . store . GraphRoot ( ) + " " namespaces := [ ] string { } if s . named != nil { if s . id != " " { // The reference without the ID is also a valid namespace. namespaces = append ( namespaces , storeSpec + s . named . String ( ) ) } tagged , isTagged := s . named . ( reference . Tagged ) _ , isDigested := s . named . ( reference . Digested ) if isTagged && isDigested { // s.named is "name:tag@digest"; add a "name:tag" parent namespace. namespaces = append ( namespaces , storeSpec + s . named . Name ( ) + " " + tagged . Tag ( ) ) } components := strings . Split ( s . named . Name ( ) , " " ) for len ( components ) > 0 { namespaces = append ( namespaces , storeSpec + strings . Join ( components , " " ) ) components = components [ : len ( components ) - 1 ] } } namespaces = append ( namespaces , storeSpec ) namespaces = append ( namespaces , driverlessStoreSpec ) return namespaces }
// Also accept policy that's tied to the combination of the graph root and
// driver name, to apply to all images stored in the Store, and to just the
// graph root, in case we're using multiple drivers in the same directory for
// some reason.
Also accept policy that s tied to the combination of the graph root and driver name to apply to all images stored in the Store and to just the graph root in case we re using multiple drivers in the same directory for some reason .