Skip to content

Commit

Permalink
Use sudo to upload k0s to /usr/local/bin (#706)
Browse files Browse the repository at this point in the history
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
  • Loading branch information
kke authored May 10, 2024
1 parent d8af765 commit 973541d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions phase/upload_k0s.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ func (p *UploadK0s) uploadBinary(h *cluster.Host) error {
}

log.Infof("%s: uploading k0s binary from %s to %s", h, h.UploadBinaryPath, tmp)
if err := h.Upload(h.UploadBinaryPath, tmp); err != nil {
if err := h.Upload(h.UploadBinaryPath, tmp, exec.Sudo(h)); err != nil {
return fmt.Errorf("upload k0s binary: %w", err)
}

if err := h.Configurer.Touch(h, tmp, stat.ModTime()); err != nil {
if err := h.Configurer.Touch(h, tmp, stat.ModTime(), exec.Sudo(h)); err != nil {
return fmt.Errorf("failed to touch %s: %w", tmp, err)
}
if err := h.Execf(`chmod +x "%s"`, tmp, exec.Sudo(h)); err != nil {
Expand Down

0 comments on commit 973541d

Please sign in to comment.