You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RFE: Provide a way for apps to determine whether a user config was provided #903
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
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.
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.
Activity
sohankunkerkar commentedon Mar 23, 2020
Can you elaborate more on
all the sourcesin the above comment?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.
jlebon commentedon Mar 23, 2020
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.urlor via/usr/lib/ignition/user.ign).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:
ignition/internal/exec/engine.go
Line 88 in 7d8410b
jlebon commentedon Mar 23, 2020
I think just logging into the journal for now would be easier & cleaner.