Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[teleport-update] Improve clarity of error logs and address UX edge cases #52777

Merged
merged 11 commits into from
Mar 12, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
check extra case
sclevine committed Mar 12, 2025
commit 0fdf2ec949f3100295a26191893534b71d090019
8 changes: 7 additions & 1 deletion lib/autoupdate/agent/updater.go
Original file line number Diff line number Diff line change
@@ -455,8 +455,14 @@ func (u *Updater) Remove(ctx context.Context, force bool) error {
}

// Do not link system package installation if the installation we are removing
// is not installed into /usr/local/bin.
// is not installed into /usr/local/bin. In this case, we also need to make sure
// it is clear we are not going to recover the package's systemd service if it
// was overwritten.
if filepath.Clean(cfg.Spec.Path) != filepath.Clean(defaultPathDir) {
if u.TeleportServiceName == serviceName && !force {
u.Log.ErrorContext(ctx, "Default Teleport systemd service would be removed, and --force was not passed. Refusing to remove Teleport from this system.")
return trace.Errorf("unable to remove Teleport completely without --force")
}
return u.removeWithoutSystem(ctx, cfg)
}
revert, err := u.Installer.LinkSystem(ctx)