mirror of
https://github.com/pgsty/minio.git
synced 2026-07-27 16:06:16 +03:00
Fix resetting a config with a non default target name (#15448)
mc admin config reset <alias> notify_webhook:something was not working
properly.
The reason is that GetSubSys() was not calculating the target
name properly because it is quitting early when the number of config
inputs ('notify_webhook:something' in this case) is equal to 1.
This commit will make the code calculates always calculate the target
name if found.
This commit is contained in:
@@ -836,10 +836,6 @@ func GetSubSys(s string) (subSys string, inputs []string, tgt string, e error) {
|
|||||||
return subSys, inputs, tgt, Errorf("unknown sub-system %s", s)
|
return subSys, inputs, tgt, Errorf("unknown sub-system %s", s)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(inputs) == 1 {
|
|
||||||
return subSys, inputs, tgt, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
if SubSystemsSingleTargets.Contains(subSystemValue[0]) && len(subSystemValue) == 2 {
|
if SubSystemsSingleTargets.Contains(subSystemValue[0]) && len(subSystemValue) == 2 {
|
||||||
return subSys, inputs, tgt, Errorf("sub-system '%s' only supports single target", subSystemValue[0])
|
return subSys, inputs, tgt, Errorf("sub-system '%s' only supports single target", subSystemValue[0])
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user