Skip to content

ENT-13005: Added integrity check to cf-remote remote installation#174

Open
victormlg wants to merge 1 commit intocfengine:masterfrom
victormlg:improved-remote-download
Open

ENT-13005: Added integrity check to cf-remote remote installation#174
victormlg wants to merge 1 commit intocfengine:masterfrom
victormlg:improved-remote-download

Conversation

@victormlg
Copy link
Contributor

No description provided.

@victormlg victormlg force-pushed the improved-remote-download branch from 6c48260 to f43babf Compare February 24, 2026 16:06
@victormlg victormlg requested a review from larsewi March 2, 2026 08:51
@victormlg victormlg force-pushed the improved-remote-download branch from f43babf to c52900a Compare March 2, 2026 13:12
@victormlg victormlg requested a review from larsewi March 2, 2026 13:14
Copy link
Contributor

@larsewi larsewi left a comment

Choose a reason for hiding this comment

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

Remember to test the script 😉

@victormlg victormlg force-pushed the improved-remote-download branch from c52900a to b680be0 Compare March 3, 2026 11:44
@victormlg victormlg requested a review from larsewi March 3, 2026 11:49
Copy link
Contributor

@larsewi larsewi left a comment

Choose a reason for hiding this comment

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

Most of these checks can be done before you actually download the file. Maybe do these checks first, and then download.

@victormlg victormlg force-pushed the improved-remote-download branch from b680be0 to 8cb770f Compare March 3, 2026 14:15
@victormlg victormlg requested a review from larsewi March 3, 2026 15:24
Copy link
Member

@olehermanse olehermanse left a comment

Choose a reason for hiding this comment

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

Please expand nt-discovery.sh and then do the error checking as early as possible (as fast as possible). This way you can detect errors right after running nt-discovery.sh, without having to transfer over another script.

@victormlg victormlg force-pushed the improved-remote-download branch 2 times, most recently from 3e755d9 to ea263af Compare March 9, 2026 10:07
@victormlg victormlg requested a review from olehermanse March 9, 2026 10:25
Ticket: ENT-13005
Signed-off-by: Victor Moene <victor.moene@northern.tech>
@victormlg victormlg force-pushed the improved-remote-download branch from ea263af to ca9da21 Compare March 9, 2026 10:30
if insecure:
log.warning(ret)

log.debug("Successfully remotely installed package on host")
Copy link
Contributor

Choose a reason for hiding this comment

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

The script only downloads, it does not install?

Suggested change
log.debug("Successfully remotely installed package on host")
log.debug("Successfully remotely downloaded package on host")

):

if not pkg_binary:
return None
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there be an error message here?

return package

def _remote_download(
host, package, artifact, pkg_binary, insecure=False, connection=None
Copy link
Contributor

Choose a reason for hiding this comment

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

A doc string explaining the arguments would be very helpful

if ret is None:
return None
if insecure:
log.warning(ret)
Copy link
Contributor

Choose a reason for hiding this comment

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

What is logged here? The return code? The entire SSH output?

cleanup() {
rm -f "$tmpfile"
}
trap cleanup EXIT QUIT TERM
Copy link
Contributor

Choose a reason for hiding this comment

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

Should INT be included to clean up on Ctrl+C?


if [ "$HAS_WGET" -eq 1 ]; then
wget -nv -O "$tmpfile" "$PACKAGE"
else
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
else
else


print("Downloading '%s' on '%s' using curl" % (package, host))
r = ssh_cmd(
cmd="curl --fail -O {}".format(package), connection=connection, errors=True
Copy link
Contributor

Choose a reason for hiding this comment

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

This code preferred curl. Why is wget preferred now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants