mirror of
https://github.com/apricote/hcloud-upload-image.git
synced 2026-01-13 13:21:01 +00:00
parent
8347e4ef16
commit
256989f4a3
1 changed files with 4 additions and 0 deletions
|
|
@ -299,6 +299,10 @@ func (s *Client) Upload(ctx context.Context, options UploadOptions) (*hcloud.Ima
|
|||
}
|
||||
|
||||
cmd += "dd of=/dev/sda bs=4M && sync"
|
||||
|
||||
// Make sure that we fail early, ie. if the image url does not work.
|
||||
// the pipefail does not work correctly without wrapping in bash.
|
||||
cmd = fmt.Sprintf("bash -c 'set -euo pipefail && %s'", cmd)
|
||||
logger.DebugContext(ctx, "running download, decompress and write to disk command", "cmd", cmd)
|
||||
|
||||
output, err := sshsession.Run(sshClient, cmd, options.ImageReader)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue