Default DeleteReplication rule status if unspecified. (#15301)

Since this is a MinIO specific extension in the replication config,
default this to Disabled to allow other sdks to be used to configure
replication rules.

Co-authored-by: Poorna Krishnamoorthy <poorna@minio.io>
This commit is contained in:
Poorna
2022-07-14 16:27:09 -07:00
committed by GitHub
parent bb4b143f3b
commit 53cc561048
2 changed files with 8 additions and 2 deletions
@@ -62,6 +62,12 @@ func ParseConfig(reader io.Reader) (*Config, error) {
},
}
}
// Default DeleteReplication to disabled if unset.
if len(config.Rules[i].DeleteReplication.Status) == 0 {
config.Rules[i].DeleteReplication = DeleteReplication{
Status: Disabled,
}
}
}
return &config, nil
}