Skip to content

RFE: Provide a way for apps to determine whether a user config was provided #903

Closed

Description

@jlebon

Right now, there's no practical way to confirm whether a user config was provided. A few ideas discussed during a community meeting:

  • have Ignition write a e.g. /run/ignition-sources.json containing the list of all the sources it merged along with the hash for each. Include whether it was a "base" config or a "user" config
  • just log in the journal or persist the hash of the user config before merging into the base config

This would be useful for coreos/fedora-coreos-tracker#279.

Activity

  1. added
    jira
    on Mar 23, 2020
  2. sohankunkerkar commented on Mar 23, 2020

    @sohankunkerkar
    Contributor

    containing the list of all the sources it merged along with the hash for each

    Can you elaborate more on all the sources in the above comment?

    just log in the journal or persist the hash of the user config before merging into the base config

    Could you please clarify the above line?(need some technical background as to how the user config gets merged into the base config). Any references/pointers would be appreciated.

  3. jlebon commented on Mar 23, 2020

    @jlebon
    MemberAuthor

    containing the list of all the sources it merged along with the hash for each

    Can you elaborate more on all the sources in the above comment?

    Sure! There's currently two possible sources of Ignition configs (ignoring those fetched recursively): a base config, and a user-provided one. The base config is shipped as part of the OS. See e.g. https://github.com/coreos/fedora-coreos-config/blob/6b98eceb093ca33c1c0f1fa0aed17676847cf4a6/overlay.d/10coreuser/usr/lib/dracut/modules.d/40ignition-conf/base.ign. The user config is provided by the user at runtime (normally via a provider-specific mechanism, but it could be via ignition.config.url or via /usr/lib/ignition/user.ign).

    just log in the journal or persist the hash of the user config before merging into the base config

    Could you please clarify the above line?(need some technical background as to how the user config gets merged into the base config). Any references/pointers would be appreciated.

    Essentially, in this alternative, Ignition would log structured journal entries with well-known IDs whenever it fetched a new config (see an example of this in https://github.com/coreos/rpm-ostree/blob/659fb0b23a94a4fec17518eef42d47215687ad75/src/daemon/rpmostree-sysroot-upgrader.c#L1312, but I'm sure there are Golang bindings available too). If we do this, we want to make sure to log the hash of the configs individually, not of the merged config.

    You can see the code where the base config and the user config are merged here:

    fullConfig := latest.Merge(baseConfig, latest.Merge(systemBaseConfig, cfg))

  4. jlebon commented on Mar 23, 2020

    @jlebon
    MemberAuthor

    I think just logging into the journal for now would be easier & cleaner.

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

Metadata

Metadata

Labels

jira

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions