efrecon / docker-s3fs-client

Alpine-based s3fs client: mount from container, make available to other containers
BSD 3-Clause "New" or "Revised" License
173 stars 62 forks source link

Fix mounted check when using volumes #3

Closed totycro closed 4 years ago

totycro commented 4 years ago

The old check did a grep for "s3fs", but that actually occurs in the default mount path, so doesn't actually filter volumes.

This is an example from my k8s environment: $ mount | grep s3fs | grep "${AWS_S3_MOUNT}" /dev/nvme0n1p1 on /opt/s3fs/bucket type xfs (rw,noatime,attr2,inode64,noquota) s3fs on /opt/s3fs/bucket type fuse.s3fs (ro,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)

As you can see, the first line is always matched, even though the mount might not have succeded.