Skip to content

Commit

Permalink
Added option to enable back ILM expiry for replication
Browse files Browse the repository at this point in the history
Signed-off-by: Shubhendu Ram Tripathi <[email protected]>
  • Loading branch information
shtripat committed Oct 17, 2023
1 parent 3fb3127 commit be3553c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
15 changes: 13 additions & 2 deletions cmd/admin-replicate-update.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ var adminReplicateUpdateFlags = []cli.Flag{
Name: "disable-ilm-expiry-replication",
Usage: "disable ILM expiry rules replication",
},
cli.BoolFlag{
Name: "enable-ilm-expiry-replication",
Usage: "enable ILM expiry rules replication",
},
}

var adminReplicateUpdateCmd = cli.Command{
Expand Down Expand Up @@ -81,6 +85,9 @@ EXAMPLES:
2. Disable replication of ILM expiry in cluster-level replication:
{{.Prompt}} {{.HelpName}} myminio --deployment-id c1758167-4426-454f-9aae-5c3dfdf6df64 --disable-ilm-expiry-replication
3. Enable replication of ILM expiry in cluster-level replication:
{{.Prompt}} {{.HelpName}} myminio --deployment-id c1758167-4426-454f-9aae-5c3dfdf6df64 --enable-ilm-expiry-replication
`,
}

Expand Down Expand Up @@ -129,12 +136,15 @@ func mainAdminReplicateUpdate(ctx *cli.Context) error {
if !ctx.IsSet("deployment-id") {
fatalIf(errInvalidArgument(), "--deployment-id is a required flag")
}
if !ctx.IsSet("endpoint") && !ctx.IsSet("mode") && !ctx.IsSet("sync") && !ctx.IsSet("disable-ilm-expiry-replication") {
fatalIf(errInvalidArgument(), "--endpoint, --mode or disable-ilm-expiry-replication is a required flag")
if !ctx.IsSet("endpoint") && !ctx.IsSet("mode") && !ctx.IsSet("sync") && !ctx.IsSet("disable-ilm-expiry-replication") && !ctx.IsSet("enable-ilm-expiry-replication") {
fatalIf(errInvalidArgument(), "--endpoint, --mode, disable-ilm-expiry-replication or enable-ilm-expiry-replication is a required flag")
}
if ctx.IsSet("mode") && ctx.IsSet("sync") {
fatalIf(errInvalidArgument(), "either --sync or --mode flag should be specified")
}
if ctx.IsSet("disable-ilm-expiry-replication") && ctx.IsSet("enable-ilm-expiry-replication") {
fatalIf(errInvalidArgument(), "either --disable-ilm-expiry-replication or --enable-ilm-expiry-replication flag should be specified")
}

var syncState string
if ctx.IsSet("sync") { // for backward compatibility - deprecated Jul 2023
Expand Down Expand Up @@ -168,6 +178,7 @@ func mainAdminReplicateUpdate(ctx *cli.Context) error {
}
var opts madmin.SREditOptions
opts.DisableILMExpiryReplication = ctx.Bool("disable-ilm-expiry-replication")
opts.EnableILMExpiryReplication = ctx.Bool("enable-ilm-expiry-replication")
res, e := client.SiteReplicationEdit(globalContext, madmin.PeerInfo{
DeploymentID: ctx.String("deployment-id"),
Endpoint: ep,
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ require (
github.com/kr/pretty v0.3.1 // indirect
github.com/minio/mux v1.9.0 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/safchain/ethtool v0.3.0 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb // indirect
Expand Down Expand Up @@ -128,4 +127,4 @@ require (
gopkg.in/ini.v1 v1.67.0 // indirect
)

replace github.com/minio/madmin-go/v3 v3.0.21 => github.com/shtripat/madmin-go/v3 v3.0.0-20231012100328-e3cb014d93b4
replace github.com/minio/madmin-go/v3 v3.0.21 => github.com/shtripat/madmin-go/v3 v3.0.0-20231017111648-65788bbf47a1
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjR
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/safchain/ethtool v0.3.0 h1:gimQJpsI6sc1yIqP/y8GYgiXn/NjgvpM0RNoWLVVmP0=
github.com/safchain/ethtool v0.3.0/go.mod h1:SA9BwrgyAqNo7M+uaL6IYbxpm5wk3L7Mm6ocLW+CJUs=
github.com/secure-io/sio-go v0.3.1 h1:dNvY9awjabXTYGsTF1PiCySl9Ltofk9GA3VdWlo7rRc=
github.com/secure-io/sio-go v0.3.1/go.mod h1:+xbkjDzPjwh4Axd07pRKSNriS9SCiYksWnZqdnfpQxs=
github.com/shirou/gopsutil/v3 v3.23.8 h1:xnATPiybo6GgdRoC4YoGnxXZFRc3dqQTGi73oLvvBrE=
Expand All @@ -216,8 +214,8 @@ github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFt
github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ=
github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU=
github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k=
github.com/shtripat/madmin-go/v3 v3.0.0-20231012100328-e3cb014d93b4 h1:m75WkTz0ey4Gbl8POaf+hFCyhRiI6EUVm5i84uGOQD8=
github.com/shtripat/madmin-go/v3 v3.0.0-20231012100328-e3cb014d93b4/go.mod h1:4QN2NftLSV7MdlT50dkrenOMmNVHluxTvlqJou3hte8=
github.com/shtripat/madmin-go/v3 v3.0.0-20231017111648-65788bbf47a1 h1:FkfzyBLsLM5uX4+cdaMfuY+6WDos/VB9lOHeyviKhZE=
github.com/shtripat/madmin-go/v3 v3.0.0-20231017111648-65788bbf47a1/go.mod h1:B2EgtEGrfWx+AkXv+OAcS6IHwoIJcd1p75QfDPSPd6Q=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down

0 comments on commit be3553c

Please sign in to comment.