mirror of
https://github.com/versity/versitygw.git
synced 2026-09-26 18:04:36 +00:00
feat: add project id support for scoutfs backend
The scoutfs filesystem allows setting project IDs on files and directories for project level accounting tracking. This adds the option to set the project id for the following: create bucket put object put part complete multipart upload The project id will only be set if all of the following is true: - set project id option enabled - filesystem format version supports projects (version >1) - account project id > 0
This commit is contained in:
@@ -26,6 +26,7 @@ import (
|
||||
var (
|
||||
glacier bool
|
||||
disableNoArchive bool
|
||||
setProjectID bool
|
||||
)
|
||||
|
||||
func scoutfsCommand() *cli.Command {
|
||||
@@ -66,6 +67,12 @@ move interfaces as well as support for tiered filesystems.`,
|
||||
EnvVars: []string{"VGW_CHOWN_GID"},
|
||||
Destination: &chowngid,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "projectid",
|
||||
Usage: "set project id on newly created buckets, files, and directories to client account ProjectID",
|
||||
EnvVars: []string{"VGW_SET_PROJECT_ID"},
|
||||
Destination: &setProjectID,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "bucketlinks",
|
||||
Usage: "allow symlinked directories at bucket level to be treated as buckets",
|
||||
@@ -114,6 +121,7 @@ func runScoutfs(ctx *cli.Context) error {
|
||||
opts.DisableNoArchive = disableNoArchive
|
||||
opts.VersioningDir = versioningDir
|
||||
opts.ValidateBucketNames = disableStrictBucketNames
|
||||
opts.SetProjectID = setProjectID
|
||||
|
||||
be, err := scoutfs.New(ctx.Args().Get(0), opts)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user