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

Client tools auto update #47466

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Client tools auto update #47466

wants to merge 14 commits into from

Conversation

vapopov
Copy link
Contributor

@vapopov vapopov commented Oct 10, 2024

In this PR implemented logic for client tools auto update {tsh, tctl} described in this RFD #39805

Update logic downloads Teleport binaries from CDN, extracts data in tools sub-directory (going to be used $TELEPORT_HOME/bin/{UUID-update-pkg}/{tsh,tctl}) and creates symlinks for {tsh,tctl} to $TELEPORT_HOME/bin/{tsh,tctl}.
Added integration tests which compiles updater binary with update logic only to simulate command execution with requested version to downloads them from fake test CDN server.

@vapopov vapopov added the no-changelog Indicates that a PR does not require a changelog entry label Oct 10, 2024
return 0, trace.Errorf("invalid size")
}
avail := stat.Bavail * uint64(stat.Bsize)
avail := uint64(stat.Bavail) * uint64(stat.Bsize)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change related to this comment #47060 (comment)
also I'm locally checking linter for warnings related touint64(stat.Bavail)

integration/autoupdate/client_update_test.go Outdated Show resolved Hide resolved
lib/autoupdate/client_update.go Outdated Show resolved Hide resolved
lib/autoupdate/client_update.go Outdated Show resolved Hide resolved
lib/autoupdate/client_update.go Outdated Show resolved Hide resolved
lib/autoupdate/client_update.go Outdated Show resolved Hide resolved
lib/autoupdate/client_update.go Outdated Show resolved Hide resolved
lib/autoupdate/client_update.go Outdated Show resolved Hide resolved
lib/autoupdate/client_update.go Outdated Show resolved Hide resolved
lib/autoupdate/progress.go Outdated Show resolved Hide resolved
lib/autoupdate/utils.go Outdated Show resolved Hide resolved
Move integration tests to client tools specific dir
Use context cancellation with SIGTERM, SIGINT
Remove cancelable tee reader with context replacement
Renaming
Fix archive cleanup if hash is not valid
Limit the archive write bytes
lib/autoupdate/tools/utils.go Outdated Show resolved Hide resolved
integration/autoupdate/tools/main_test.go Outdated Show resolved Hide resolved
lib/autoupdate/tools/updater.go Outdated Show resolved Hide resolved
lib/autoupdate/tools/updater.go Outdated Show resolved Hide resolved
lib/autoupdate/tools/updater.go Outdated Show resolved Hide resolved
lib/autoupdate/tools/updater.go Outdated Show resolved Hide resolved
@vapopov vapopov requested a review from sclevine October 16, 2024 22:27
integration/autoupdate/tools/main_test.go Outdated Show resolved Hide resolved
integration/autoupdate/tools/updater_test.go Outdated Show resolved Hide resolved
lib/autoupdate/tools/utils.go Outdated Show resolved Hide resolved
lib/autoupdate/tools/updater.go Outdated Show resolved Hide resolved
lib/autoupdate/tools/updater.go Outdated Show resolved Hide resolved
lib/autoupdate/tools/updater.go Outdated Show resolved Hide resolved
lib/autoupdate/tools/updater.go Outdated Show resolved Hide resolved
lib/autoupdate/tools/updater.go Outdated Show resolved Hide resolved
lib/autoupdate/tools/updater.go Outdated Show resolved Hide resolved
lib/autoupdate/tools/updater.go Outdated Show resolved Hide resolved
Replace hash for bytes matching
Proper temp file close for archive download
@vapopov vapopov requested a review from sclevine October 17, 2024 20:17
// FlagEnt represents enterprise version.
FlagEnt = 1 << iota
// FlagFips represents enterprise version with fips feature enabled.
FlagFips
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
FlagFips
FlagFIPS

}
}

return filepath.Join(filepath.Clean(home), ".tsh", "bin"), nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that filepath.Join runs filepath.Clean on the result for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Indicates that a PR does not require a changelog entry size/lg
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants