From 807f8a575455147e4af59f2c9c59457d44e5bbc2 Mon Sep 17 00:00:00 2001 From: Stephen Levine Date: Fri, 24 Jan 2025 18:27:13 -0500 Subject: [PATCH] cleanup --- lib/autoupdate/agent/updater.go | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/lib/autoupdate/agent/updater.go b/lib/autoupdate/agent/updater.go index ccf20c62939fe..b9ddd2d466567 100644 --- a/lib/autoupdate/agent/updater.go +++ b/lib/autoupdate/agent/updater.go @@ -773,13 +773,9 @@ func (u *Updater) update(ctx context.Context, cfg *UpdateConfig, target Revision u.Log.InfoContext(ctx, "Backup version set.", backupKey, r) } - if err := u.cleanup(ctx, []Revision{ + return trace.Wrap(u.cleanup(ctx, []Revision{ target, active, backup, - }); err != nil { - return trace.Wrap(err) - } - - return trace.Wrap(u.notices(ctx)) + })) } // notices displays final notices after install or update. @@ -794,21 +790,18 @@ func (u *Updater) notices(ctx context.Context) error { } if !enabled && active { //nolint:sloglint // sum of constants - u.Log.WarnContext(ctx, "Teleport is installed and started, but not configured to start on boot.\n"+ - "After configuring teleport.yaml, you can enable it with:\n"+ - "\tsystemctl enable teleport") + u.Log.WarnContext(ctx, "Teleport is installed and started, but not configured to start on boot. "+ + "After configuring teleport.yaml, you can enable it with: systemctl enable teleport") } if !active && enabled { //nolint:sloglint // sum of constants - u.Log.WarnContext(ctx, "Teleport is installed and enabled at boot, but not running.\n"+ - "After configuring teleport.yaml, you can start it with:\n"+ - "\tsystemctl start teleport") + u.Log.WarnContext(ctx, "Teleport is installed and enabled at boot, but not running. "+ + "After configuring teleport.yaml, you can start it with: systemctl start teleport") } if !active && !enabled { //nolint:sloglint // sum of constants - u.Log.WarnContext(ctx, "Teleport is installed, but not running or enabled at boot.\n"+ - "After configuring teleport.yaml, you can enable and start it with:\n"+ - "\tsystemctl enable teleport --now") + u.Log.WarnContext(ctx, "Teleport is installed, but not running or enabled at boot. "+ + "After configuring teleport.yaml, you can enable and start it with: systemctl enable teleport --now") } return nil }