Skip to content

Commit 36cfc1e

Browse files
Aleksandr Snopovvitalif
authored andcommitted
add patch flags
1 parent 2f9b484 commit 36cfc1e

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

internal/cfg/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ type FlagStorage struct {
106106
MaxDiskCacheFD int64
107107
CacheFileMode os.FileMode
108108
PartSizes []PartSizeConfig
109+
UsePatch bool
110+
DropPatchConflicts bool
109111

110112
// Debugging
111113
DebugMain bool

internal/cfg/flags.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,16 @@ MISC OPTIONS:
401401
" and then 125 MB for the rest of parts",
402402
},
403403

404+
cli.BoolFlag{
405+
Name: "enable-patch",
406+
Usage: "Use PATCH method to upload object data changes to s3. Yandex only. (default: off)",
407+
},
408+
409+
cli.BoolFlag{
410+
Name: "drop-patch-conflicts",
411+
Usage: "Drop local changes in case of conflicting concurrent PATCH updates. (default: off)",
412+
},
413+
404414
cli.IntFlag{
405415
Name: "max-merge-copy",
406416
Value: 0,
@@ -823,6 +833,8 @@ func PopulateFlags(c *cli.Context) (ret *FlagStorage) {
823833
CachePath: c.String("cache"),
824834
MaxDiskCacheFD: int64(c.Int("max-disk-cache-fd")),
825835
CacheFileMode: os.FileMode(c.Int("cache-file-mode")),
836+
UsePatch: c.Bool("enable-patch"),
837+
DropPatchConflicts: c.Bool("drop-patch-conflicts"),
826838

827839
// Common Backend Config
828840
Endpoint: c.String("endpoint"),
@@ -886,7 +898,7 @@ func PopulateFlags(c *cli.Context) (ret *FlagStorage) {
886898
panic("Unknown --iam-flavor: "+config.IAMFlavor)
887899
}
888900
listType := c.String("list-type")
889-
isYandex := strings.Index(flags.Endpoint, "yandex") != -1
901+
isYandex := strings.Contains(flags.Endpoint, "yandex")
890902
if isYandex && !c.IsSet("no-specials") {
891903
flags.EnableSpecials = true
892904
}

0 commit comments

Comments
 (0)