From 10b49eb4fb93814c5061826c482632dfcae16c4c Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Mon, 1 Aug 2022 15:52:23 +0100 Subject: [PATCH] Fix resetting a config with a non default target name (#15448) mc admin config reset 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. --- internal/config/config.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 932e316a0..8765f69fe 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -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]) }