Skip to content

fedora: move per image type image config into YAML (HMS-6019) - #1494

Closed
mvo5 wants to merge 4 commits into
osbuild:mainfrom
mvo5:yaml-imageconfig-4
Closed

mvo5 wants to merge 4 commits into
osbuild:mainfrom
mvo5:yaml-imageconfig-4

Conversation

@mvo5

@mvo5 mvo5 commented May 5, 2025 •

Copy link
Copy Markdown
Contributor

[draft until https://github.com//pull/1500 is merged]

This a cleaned up split-out of #1462 - it moves the image configuration for fedora into YAML. It only needs #1500 as its prerequisite.


This commit moves the ImageConfig of each package into the
distro.yaml.


defs: implement defs.ImageConfig() for image config loading

This commit adds a new defs.ImageConfig() to load per image
type specific image config loading. This allows to write:

image_types:
  test_type:
    image_config:
      locale: "C.UTF-8"
      timezone: "DefaultTZ"
      condition:
        version_less_than:
          "2":
            timezone: "OverrideTZ"

/jira-epic HMS-6019

@schutzbot

Copy link
Copy Markdown
Collaborator

This PR changes the images API or behaviour causing integration failures with osbuild-composer. The next update of the images dependency in osbuild-composer will need work to adapt to these changes.

This is simply a notice. It will not block this PR from being merged.


func imageConfig(d distribution, imageType string) *distro.ImageConfig {
// arch is currently not used in fedora
arch := ""

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This should probably still be wired up or there will be a surprise if we try to use it.

mvo5 added 4 commits May 6, 2025 13:53
When validating paths in the fsnode module, use the `filepath`
module instead of the (more generic) `path`.
When we move `ImageConfig` into YAML we will need support for
`fsnode.{Dir,File}` as it is used as part of the ImageConfig.

This commit adds support for JSON/YAML unmarshaling.
This commit adds a new `defs.ImageConfig()` to load per image
type specific image config loading. This allows to write:
```yaml
image_types:
  test_type:
    image_config:
      locale: "C.UTF-8"
      timezone: "DefaultTZ"
      condition:
        version_less_than:
          "2":
            timezone: "OverrideTZ"
```
This commit moves the `ImageConfig` of each package into the
distro.yaml.
@mvo5
mvo5 force-pushed the yaml-imageconfig-4 branch from 89f3c7a to e6a1153 Compare May 6, 2025 20:03
@mvo5 mvo5 changed the title fedora: move per image type image config into YAML fedora: move per image type image config into YAML (HMS-6019) May 9, 2025
@mvo5

mvo5 commented May 9, 2025

Copy link
Copy Markdown
Contributor Author

Closing in favor of #1508

@mvo5 mvo5 closed this May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants