From dba79e8c7ec3c801926e92928e15725165395c8b Mon Sep 17 00:00:00 2001 From: Tim Buckley Date: Wed, 16 Mar 2022 15:46:19 -0600 Subject: [PATCH] Fix improper default value check in tbot's `FromCLIConf()` (#11169) The default `join_method` value was improperly assumed to be "" which caused any onboarding config from the config file to be overwritten. This uses the correct default and allows bots to be fully onboarded via config file. Fixes #11099 --- tool/tbot/config/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/tbot/config/config.go b/tool/tbot/config/config.go index f0bbb0129d393..70d2f2943440d 100644 --- a/tool/tbot/config/config.go +++ b/tool/tbot/config/config.go @@ -277,7 +277,7 @@ func FromCLIConf(cf *CLIConf) (*BotConfig, error) { // (CAPath, CAPins, etc follow different codepaths so we don't want a // situation where different fields become set weirdly due to struct // merging) - if cf.Token != "" || len(cf.CAPins) > 0 || cf.JoinMethod != "" { + if cf.Token != "" || len(cf.CAPins) > 0 || cf.JoinMethod != DefaultJoinMethod { onboarding := config.Onboarding if onboarding != nil && (onboarding.Token != "" || onboarding.CAPath != "" || len(onboarding.CAPins) > 0) || cf.JoinMethod != DefaultJoinMethod { // To be safe, warn about possible confusion.