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
Canonicalize the fetch stage as the only stage during which Ignition fetches configs #950
Noticed this while examining the logs for a different reason. It looks like Ignition doesn't cache the fact that an Ignition config wasn't provided when it gets HTTP 200 with an empty body. So it ends up trying to refetch the config on each stage.
We should cache it instead (e.g. as just {} in /run/ignition.json?) and avoid spamming the metadata server.
Reacted by Pierre-Emmanuel Jacquier, Benjamin Gilbert, Dusty Mabe and Luca Bruno
though another question to ask is should ignition try to fetch configs in multiple stages at all? It seems like there should only be one stage that ever tries to fetch and condense an ignition config for the system. All other stages use that initial stage's output (let's say it's a written local file) as their input.
i.e. instead of solving this problem of "Ignition shouldn't try to refetch empty configs" we restate it to "Ignition should only ever try to fetch configs in one stage".
@dustymabe I think that's fair. The current stage structure evolved over time, and now that we have a distinct fetch stage, we don't need to think of ignition.json as a cache anymore.
changed the title [-]Ignition shouldn't try to refetch empty configs[/-][+]Canonicalize the fetch stage as the only stage during which Ignition fetches configs[/+]on Mar 30, 2020
Nice - it seems like we're mostly in agreement and I see @jlebon changed the title of this issue to denote the change in scope. @jlebon as part of this we should probably be able to make "detecting if a config was provided to the machine (either fetched or embedded)" easier (#903) ?
@jlebon as part of this we should probably be able to make "detecting if a config was provided to the machine (either fetched or embedded)" easier (#903) ?
Yeah, I think you're right in that it simplifies the "only emit a message once" bit. Though I expect this issue will mostly be about moving code around, so I told @sohankunkerkar to keep working with what he has and we can rebase changes needed for this issue on top of his work.
Sorry about that @lucab, in hindsight I should have updated the commit message for that commit to make it more obvious that it was now doing more than just always writing the cache config.
Activity
jlebon commentedon Mar 27, 2020
Related: coreos/fedora-coreos-tracker#436
jlebon commentedon Mar 27, 2020
Also related: #903
coreos-teardown-initramfs-network: order ExecStop after other ignitio…
dustymabe commentedon Mar 30, 2020
though another question to ask is should ignition try to fetch configs in multiple stages at all? It seems like there should only be one stage that ever tries to fetch and condense an ignition config for the system. All other stages use that initial stage's output (let's say it's a written local file) as their input.
dustymabe commentedon Mar 30, 2020
i.e. instead of solving this problem of "Ignition shouldn't try to refetch empty configs" we restate it to "Ignition should only ever try to fetch configs in one stage".
bgilbert commentedon Mar 30, 2020
@dustymabe I think that's fair. The current stage structure evolved over time, and now that we have a distinct fetch stage, we don't need to think of
ignition.jsonas a cache anymore.jlebon commentedon Mar 30, 2020
Yup, agreed with the above. Keeping it to the
fetchstage helps with solving the conditional networking issue as well.coreos-teardown-initramfs-network: order ExecStop after other ignitio…
coreos-teardown-initramfs-network: order ExecStop after other ignitio…
coreos-teardown-initramfs-network: order ExecStop after other ignitio…
[-]Ignition shouldn't try to refetch empty configs[/-][+]Canonicalize the fetch stage as the only stage during which Ignition fetches configs[/+]dustymabe commentedon Mar 30, 2020
Nice - it seems like we're mostly in agreement and I see @jlebon changed the title of this issue to denote the change in scope. @jlebon as part of this we should probably be able to make "detecting if a config was provided to the machine (either fetched or embedded)" easier (#903) ?
jlebon commentedon Apr 1, 2020
Yeah, I think you're right in that it simplifies the "only emit a message once" bit. Though I expect this issue will mostly be about moving code around, so I told @sohankunkerkar to keep working with what he has and we can rebase changes needed for this issue on top of his work.
lucab commentedon Jul 29, 2020
This ticket got closed, so are we now guaranteeing that "Ignition fetches the configuration only once in the fetch stage"?
bgilbert commentedon Jul 29, 2020
Yes, 88013e5 changed the acquire logic to ensure that.
arithx commentedon Jul 30, 2020
Sorry about that @lucab, in hindsight I should have updated the commit message for that commit to make it more obvious that it was now doing more than just always writing the cache config.
LorbusChris commentedon Aug 14, 2020
this issue is referenced here: https://github.com/coreos/ignition/pull/958/files#diff-e3491b7c0e160811ce6761d5a1117558R95
ptal @sohankunkerkar
jlebon commentedon Aug 21, 2020
Follow-up in #1075.