func (m *mountPoint) Setup() (string, error) {
	if m.Volume != nil {
		return m.Volume.Mount()
	}

	if len(m.Source) > 0 {
		if _, err := os.Stat(m.Source); err != nil {
			if !os.IsNotExist(err) {
				return "", err
			}
			logrus.Warnf("Auto-creating non-existant volume host path %s, this is deprecated and will be removed soon", m.Source)
			if err := system.MkdirAll(m.Source, 0755); err != nil {
				return "", err
			}
		}
		return m.Source, nil
	}

	return "", derr.ErrorCodeMountSetup
}
// Setup sets up a mount point by either mounting the volume if it is
// configured, or creating the source directory if supplied.
Setup sets up a mount point by either mounting the volume if it is
configured, or creating the source directory if supplied.
// Setup sets up a mount point by either mounting the volume if it is // configured or creating the source directory if supplied .
func (m *mountPoint) Setup() (string, error) {
	if m.Volume != nil {
		return m.Volume.Mount()
	}
	if len(m.Source) > 0 {
		if _, err := os.Stat(m.Source); err != nil {
			if !os.IsNotExist(err) {
				return "", err
			}
			logrus.Warnf("Auto-creating non-existant volume host path %s, this is deprecated and will be removed soon", m.Source)
			if err := system.MkdirAll(m.Source, 0755); err != nil {
				return "", err
			}
		}
		return m.Source, nil
	}
	return "", derr.ErrorCodeMountSetup
}
func ( m * mountPoint ) Setup ( ) ( string , error ) { if m . Volume != nil { return m . Volume . Mount ( ) } if len ( m . Source ) > 0 { if _ , err := os . Stat ( m . Source ) ; err != nil { if ! os . IsNotExist ( err ) { return " " , err } logrus . Warnf ( " " , m . Source ) if err := system . MkdirAll ( m . Source , 0755 ) ; err != nil { return " " , err } } return m . Source , nil } return " " , derr . ErrorCodeMountSetup }
Setup sets up a mount point by either mounting the volume if it is
configured, or creating the source directory if supplied.
Setup sets up a mount point by either mounting the volume if it is configured or creating the source directory if supplied .