Flatcar: add target for Flatcar-compatible systemd sysext images#973
Open
kartikjoshi21 wants to merge 5 commits intoproject-dalec:mainfrom
Open
Flatcar: add target for Flatcar-compatible systemd sysext images#973kartikjoshi21 wants to merge 5 commits intoproject-dalec:mainfrom
kartikjoshi21 wants to merge 5 commits intoproject-dalec:mainfrom
Conversation
Signed-off-by: Kartik Joshi <karikjoshi21@gmail.com>
Signed-off-by: Kartik Joshi <karikjoshi21@gmail.com>
Signed-off-by: Kartik Joshi <karikjoshi21@gmail.com>
…ages This PR introduces initial Flatcar support by adding a new flatcar build target that produces Flatcar-compatible systemd system extension images (.raw). Signed-off-by: Kartik Joshi <karikjoshi21@gmail.com>
Signed-off-by: Kartik Joshi <karikjoshi21@gmail.com>
81fcf97 to
fc4ff38
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new Flatcar build target to Dalec, enabling production of Flatcar-compatible systemd system extension (.raw) images. The implementation follows established patterns in the codebase while introducing an optional interface for distro-specific sysext configuration.
Changes:
- Adds new Flatcar target with sysext support using the Flatcar SDK for building
- Introduces optional
sysextEnvProviderinterface allowing targets to supply default DALEC_SYSEXT_* environment variables - Implements smart merging logic that drops default SYSEXT_LEVEL when OS_VERSION_ID is pinned to avoid over-constraining extension matching
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| targets/linux/flatcar/flatcar.go | New Flatcar target implementation using composition pattern, delegating to Ubuntu Noble for base functionality while providing Flatcar-specific SDK worker and sysext defaults |
| targets/linux/distro_handler.go | Adds optional sysextEnvProvider interface and environment merging logic to pass DALEC_SYSEXT_* build args to build_sysext.sh with proper default handling |
| targets/linux/build_sysext.sh | Enhances script to support configurable output naming, OS ID matching, VERSION_ID/SYSEXT_LEVEL parameters, and creates proper symlinks for Flatcar naming conventions |
| targets/linux/sysext_env_test.go | Unit tests for DALEC_SYSEXT_* environment filtering and merging logic including the OS_VERSION_ID/SYSEXT_LEVEL precedence rule |
| targets/plugin/init.go | Registers new Flatcar target in plugin initialization |
| load.go | Allows DALEC_SYSEXT_* build args without requiring spec declaration |
| # systemd-sysext expects extension-release.<IMAGE> where <IMAGE> matches the image basename. | ||
| # Provide a matching entry for the produced image name. | ||
| if [ "${IMAGE_NAME}" != "${NAME}" ]; then | ||
| ln -sf "${BASE_REL}" "${REL_DIR}/extension-release.${IMAGE_NAME}" |
There was a problem hiding this comment.
The indentation here uses spaces instead of tabs, which is inconsistent with the rest of the file that uses tabs for indentation. Please change the leading spaces to a tab to maintain consistency.
Suggested change
| ln -sf "${BASE_REL}" "${REL_DIR}/extension-release.${IMAGE_NAME}" | |
| ln -sf "${BASE_REL}" "${REL_DIR}/extension-release.${IMAGE_NAME}" |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds an initial Flatcar build target to Dalec focused on producing Flatcar-compatible systemd system extension images (.raw).
Default behavior for Flatcar sysext
The Flatcar target provides defaults aligned with Flatcar expectations:
Tests
Adds unit coverage for:
Fixes: #969