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

Fix tee error when uploading k0s binaries #366

Merged
merged 2 commits into from
Apr 5, 2022

Conversation

kke
Copy link
Contributor

@kke kke commented Apr 4, 2022

Fixes #357

Expands and reorders the three part host selection filter in Upload Binaries phase. This may or may not fix the tee issue.

Also changes the needsUpgrade function to return false if the host.Files or host.K0sBinaryPath have no file changes compared to remote.

@kke kke added bug Something isn't working enhancement New feature or request labels Apr 4, 2022
@kke kke requested a review from twz123 April 4, 2022 07:38
@twz123 twz123 self-assigned this Apr 4, 2022
Copy link
Member

@twz123 twz123 left a comment

Choose a reason for hiding this comment

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

This should at least skip any unnecessary uploads (given that FileChanged is reliable). It probably doesn't fix the tee issue in cases where the binary actually changed.

return true
for _, f := range h.Files {
if f.IsURL() {
log.Debugf("%s: marked for upgrade because there are URL source file uploads for the host", h)
Copy link
Member

Choose a reason for hiding this comment

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

There's even the possibility in getting the file size and modification date from an URL. A HEAD request and an inspection of the Content-Length and Last-Modified headers.

phase/gather_k0s_facts.go Show resolved Hide resolved
@kke kke merged commit 39a3f13 into main Apr 5, 2022
@kke kke deleted the finetune-upload-binaries-host-filter branch April 5, 2022 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tee: /usr/local/bin/k0s: Text file busy
2 participants