mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
Apply dynamic config at sub-system level (#14369)
Currently, when applying any dynamic config, the system reloads and re-applies the config of all the dynamic sub-systems. This PR refactors the code in such a way that changing config of a given dynamic sub-system will work on only that sub-system.
This commit is contained in:
@@ -813,18 +813,16 @@ func GetSubSys(s string) (subSys string, inputs []string, tgt string, e error) {
|
||||
return subSys, inputs, tgt, Errorf("input arguments cannot be empty")
|
||||
}
|
||||
inputs = strings.SplitN(s, KvSpaceSeparator, 2)
|
||||
if len(inputs) <= 1 {
|
||||
return subSys, inputs, tgt, Errorf("invalid number of arguments '%s'", s)
|
||||
}
|
||||
subSystemValue := strings.SplitN(inputs[0], SubSystemSeparator, 2)
|
||||
if len(subSystemValue) == 0 {
|
||||
return subSys, inputs, tgt, Errorf("invalid number of arguments %s", s)
|
||||
}
|
||||
|
||||
if !SubSystems.Contains(subSystemValue[0]) {
|
||||
subSystemValue := strings.SplitN(inputs[0], SubSystemSeparator, 2)
|
||||
subSys = subSystemValue[0]
|
||||
if !SubSystems.Contains(subSys) {
|
||||
return subSys, inputs, tgt, Errorf("unknown sub-system %s", s)
|
||||
}
|
||||
subSys = subSystemValue[0]
|
||||
|
||||
if len(inputs) == 1 {
|
||||
return subSys, inputs, tgt, nil
|
||||
}
|
||||
|
||||
if SubSystemsSingleTargets.Contains(subSystemValue[0]) && len(subSystemValue) == 2 {
|
||||
return subSys, inputs, tgt, Errorf("sub-system '%s' only supports single target", subSystemValue[0])
|
||||
|
||||
Reference in New Issue
Block a user