bottlerocket-os / twoliter

A build tool for customizing Bottlerocket
Other
24 stars 25 forks source link

krane: write krane binary to a tempfile #405

Closed sam-berning closed 2 weeks ago

sam-berning commented 2 weeks ago

Issue number:

Closes #403

Description of changes:

While looking into #403, I noticed that the krane binary produced in the build works as expected if I just copy the binary over to an affected system.

This PR changes the way that the krane-bundle lib installs krane. Instead of keeping the file in memory and sealing it, we create a temp directory and write the krane binary to that directory.

This PR also improves the error message when krane fails to run.

Testing done:

Built twoliter with

cross build --target=x86_64-unknown-linux-musl --release

and copied the produced binary over to a system that was affected by the bug in #403. I ran twoliter update in the bottlerocket repo without issue.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

cbgbt commented 2 weeks ago

Too bad that the sealed file bit struggles on some systems -- it's still not clear to me why. Nice work!

sam-berning commented 2 weeks ago

^ address comments from @cbgbt and update krane README