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:
Anis Elleuch 2022-08-01 15:52:23 +01:00 committed by GitHub
parent 3856d078d2
commit 10b49eb4fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}
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])
}