Giter VIP home page Giter VIP logo

Comments (11)

sapk avatar sapk commented on July 1, 2024 1

In managed plugin, glusterfs should be 3.13 https://packages.debian.org/fr/testing/glusterfs-client.

But, I use the glusterfs command and not mount (https://github.com/sapk/docker-volume-gluster/blob/master/gluster/driver/driver.go#L44).
This allow for multiple server as base and I don't know if it support that "new" format.
In the docs (https://docs.gluster.org/en/latest/release-notes/3.12.0/), they only with mount command.

from docker-volume-gluster.

sapk avatar sapk commented on July 1, 2024

That shouldn't be too hard to do. It maybe possible to add the subdir inside voluri and keep backward compat.

from docker-volume-gluster.

trajano avatar trajano commented on July 1, 2024

You need to have GlusterFS 3.12 at minimum for this to work. I think you may be using an older version of GlusterFS which is causing it to fail on my set up.

from docker-volume-gluster.

sapk avatar sapk commented on July 1, 2024

@trajano this is not implemented yet. I was just talking about a way to implement it.

from docker-volume-gluster.

trajano avatar trajano commented on July 1, 2024

I think if you just use Gluster 3.12 or assume Gluster 3.12 is installed (I don't think you make any assumption on what is installed though because I see the volume mounted even without the glusterfs client installed by yum) then you can simply pass in

store:/myvol/subvol

from docker-volume-gluster.

trajano avatar trajano commented on July 1, 2024

The parseVolUri needs to add --subdir-mount=SUBDIR-PATH

from docker-volume-gluster.

trajano avatar trajano commented on July 1, 2024

I tried to make it but I don't know Go well enough here's my cut

const (
	validHostnameRegex = `(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])`
	validMountRegex = `\/?([^\/]+)(/[^\/]+)?`
)

func isValidURI(volURI string) bool {
	re := regexp.MustCompile(validHostnameRegex + ":" + validMountRegex)
	return re.MatchString(volURI)
}

func parseVolURI(volURI string) string {
	volParts := strings.Split(volURI, ":")
	volServers := strings.Split(volParts[0], ",")

	re := regexp.MustCompile(validMountRegex)
	??? := re.MatchString(volParts[1])
	volumeIdPart := ???.group(1)
	subDirectoryPart := ???.group(2)
	
	if (subDirectoryPart == nil) {
		return fmt.Sprintf("--volfile-id='%s' -s '%s'", volumeIdPart, strings.Join(volServers, "' -s '"))
	} else {
		return fmt.Sprintf("--volfile-id='%s' --subdir-mount='%s' -s '%s'", volumeIdPart, subDirectoryPart, strings.Join(volServers, "' -s '"))

	}
}


from docker-volume-gluster.

sapk avatar sapk commented on July 1, 2024

I will have a look at it tommorrow.
If you want to contribute you can submit a PR with tests that should validate the change. https://github.com/sapk/docker-volume-gluster/blob/master/gluster/driver/tools_test.go
This would be a easy start at go. It is mostly adding new case to check to the two first functions.

from docker-volume-gluster.

kladiv avatar kladiv commented on July 1, 2024

Great job guys :)

from docker-volume-gluster.

sapk avatar sapk commented on July 1, 2024

Doing more tests but should release soon.

from docker-volume-gluster.

moetemad avatar moetemad commented on July 1, 2024

@sapk Has this feature made it into any of the releases yet? I am still having issues with gluster 5.3

from docker-volume-gluster.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.