Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sclevine committed Nov 21, 2024
1 parent f5ccbfd commit 8c9da6b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
13 changes: 0 additions & 13 deletions lib/autoupdate/agent/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -766,19 +766,6 @@ func (li *LocalInstaller) versionDir(version string) (string, error) {
return versionDir, nil
}

// IsLinked returns true if the version is linked or partially linked.
// Returns os.ErrNotExist error if the version does not exist.
// See Installer interface for additional specs.
func (li *LocalInstaller) IsLinked(ctx context.Context, version string) (bool, error) {
versionDir, err := li.versionDir(version)
if err != nil {
return false, trace.Wrap(err)
}
b, err := li.isLinked(filepath.Join(versionDir, "bin"))
return b, trace.Wrap(err)

}

// isLinked returns true if any binaries in binDir are linked.
// Returns os.ErrNotExist error if the binDir does not exist.
func (li *LocalInstaller) isLinked(binDir string) (bool, error) {
Expand Down
1 change: 1 addition & 0 deletions lib/autoupdate/agent/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ func (u *Updater) update(ctx context.Context, cfg *UpdateConfig, targetVersion s
}
if err != nil {
u.Log.WarnContext(ctx, "Failed to remove unused version of Teleport.", errorKey, err, "version", v)
continue
}
u.Log.WarnContext(ctx, "Deleted unused version of Teleport.", "version", v)
}
Expand Down

0 comments on commit 8c9da6b

Please sign in to comment.