-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix inconsistent state after failed prepackaged header installation (#…
…1663) Summary: Pixie's installation process requires downloading a Linux header bundle and applying patches. Issue #1056 identified that a failed installation process could lead to an inconsistent state, resulting in the error: ```bash Failed to install packaged Linux headers to /lib/modules/5.15.0-58-generic, error: Internal: Refusing to clobber existing directory: /usr/src/linux-headers-5.15.90-pl. ``` The problem was that the installation process did not clean up after a failed attempt. This PR modifies the extraction process for prepackaged Linux headers by introducing a staging directory. Extraction is now performed in this staging directory first, which helps ensure that the check for existing directories does not raise an error from a previous failed run. After successfully extracting and applying patches, the contents are moved from the staging directory to the expected directory. Additional context: The function for extraction `Minitar::Extract` was modified to accept an additional parameter, `prefix_to_strip`. This helps remove any specified prefix from the pathnames of the untarred files to prevent unnecessary nesting in the staging directory. Relevant Issues: Fixes #1092 Type of change: /kind bug Test Plan: Removed the kernel config files on a node, then installed Pixie and verified that the initial error which previously led to inconsistent state is raised: ``` Failed to install packaged Linux headers to /lib/modules/5.15.0-58-generic, error: Not Found : No kernel config found. Searched: /proc/config,/proc/config.gz,/host/boot/config-5.15.0-58-generic,/host/lib/modules/5.15.0-58-generic/config,/proc/1/root/media/sr0/boot/config-virt,/proc/1/root/media/vda/boot/config-virt. ``` After this, I added the config files back and redeployed, verifying that things work as intended i.e. that the config files are found and that there are no leftover files from a failed installation in the expected directory. --------- Signed-off-by: Benjamin Kilimnik <[email protected]>
- Loading branch information
1 parent
2b198fb
commit 1a95c5f
Showing
3 changed files
with
53 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters