github.com/wozhu6104/docker@v20.10.10+incompatible/volume/mounts/validate.go (about)

     1  package mounts // import "github.com/docker/docker/volume/mounts"
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/docker/docker/api/types/mount"
     7  	"github.com/pkg/errors"
     8  )
     9  
    10  type errMountConfig struct {
    11  	mount *mount.Mount
    12  	err   error
    13  }
    14  
    15  func (e *errMountConfig) Error() string {
    16  	return fmt.Sprintf("invalid mount config for type %q: %v", e.mount.Type, e.err.Error())
    17  }
    18  
    19  func errBindSourceDoesNotExist(path string) error {
    20  	return errors.Errorf("bind source path does not exist: %s", path)
    21  }
    22  
    23  func errExtraField(name string) error {
    24  	return errors.Errorf("field %s must not be specified", name)
    25  }
    26  func errMissingField(name string) error {
    27  	return errors.Errorf("field %s must not be empty", name)
    28  }