rancher / elemental-toolkit

:snowflake: The toolkit to build, ship and maintain cloud-init driven Linux derivatives based on container images
https://rancher.github.io/elemental-toolkit/docs/
Apache License 2.0
289 stars 49 forks source link

Preserve additional cloud-init files names during Install and Reset #2138

Closed anmazzotti closed 1 month ago

anmazzotti commented 2 months ago

Is your feature request related to a problem? Please describe.

When invoking elemental install or elemental reset, it is possible to pass a list of files that are going to be installed on the system. For example: elemental install --cloud-init /tmp/my-config.yaml,/tmp/my-other-config.yaml

Currently the elemental toolkit install these files as /oem/90_custom.yaml,/oem/91_custom.yaml, etc. This makes difficult to handle these files post installations, for example to disable or update them, because the original name is lost and it's not easy to identify which one is which.

Describe the solution you'd like

Maybe with a feature toggle to not change behavior, but it would be nice to preserve the original file name to the installed files, so that according to the sample above, they will be installed as: /oem/my-config.yaml and /oem/my-other-config.yaml.

Describe alternatives you've considered

Since the numbering is incremental, it's currently possible to predict which files is which based on order, but this is mistake prone. Another way is to read and parse all files to identify the one to update/delete, but this is a costly operation.

Additional context

anmazzotti commented 1 month ago

I'm closing this issue, as a better workaround was highlighted by @davidcassany . Using the built-in after-install and after-reset elemental hooks, it is possible to install any file in any desired path.

See https://github.com/rancher/elemental-operator/issues/806 for more info.