From 188c2a683fc55fb8b2c2cd4a6c01d8527ec6c514 Mon Sep 17 00:00:00 2001 From: Stephen Levine Date: Fri, 8 Nov 2024 14:19:13 -0500 Subject: [PATCH] warn on known edition --- lib/autoupdate/agent/updater.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/autoupdate/agent/updater.go b/lib/autoupdate/agent/updater.go index 96ff6a7b53f0c..490e436677aa1 100644 --- a/lib/autoupdate/agent/updater.go +++ b/lib/autoupdate/agent/updater.go @@ -37,6 +37,7 @@ import ( "github.com/gravitational/teleport/api/client/webclient" libdefaults "github.com/gravitational/teleport/lib/defaults" + "github.com/gravitational/teleport/lib/modules" libutils "github.com/gravitational/teleport/lib/utils" ) @@ -293,8 +294,12 @@ func (u *Updater) Enable(ctx context.Context, override OverrideConfig) error { return trace.Errorf("failed to request version from proxy: %w", err) } targetVersion = resp.AutoUpdate.AgentVersion - if resp.Edition == "ent" { + switch resp.Edition { + case modules.BuildEnterprise: flags |= FlagEnterprise + case modules.BuildOSS, modules.BuildCommunity: + default: + u.Log.WarnContext(ctx, "Unknown edition detected, defaulting to community.", "edition", resp.Edition) } if resp.FIPS { flags |= FlagFIPS