Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

converter: generate random and unique filesystem path #30

Open
tormath1 opened this issue Nov 16, 2021 · 2 comments
Open

converter: generate random and unique filesystem path #30

tormath1 opened this issue Nov 16, 2021 · 2 comments

Comments

@tormath1
Copy link

Hi,

In the current behavior of ign-converter, we rely on a fsMap in order to mitigate a change between Ignition 2.x and 3.x:

map[string]string{"var": "/var"}

without this map or the correct values in it, we fail the translation in case we hit a filesystem with no associated path:

for _, fs := range cfg.Storage.Filesystems {
if _, ok := fsMap[fs.Name]; !ok {
return util.NoFilesystemError(fs.Name)
}
}

Did we already consider in the past generating a random path associated to this filesystem name in order to circumvent this requirement ?

This is a proof-of-concept using randomized name: main...tormath1:tormath1/generate-path-upstream and the logic has been tested in Flatcar CI.

Thanks :)

@bgilbert
Copy link
Contributor

We did discuss it in the past — actually I think I may have proposed it — but ultimately we decided against it. Unfortunately I don't remember why, I don't think we recorded it anywhere, and the lead developer at the time is no longer involved in the project.

@tormath1
Copy link
Author

@bgilbert ok I see - good to know that you already considered it.

If well documented, it could be a default behavior:

  • user provides a fsMap, it behaves as currently
  • user does not provide a fsMap, it generates random path

If we really don't want to be a default behavior, we could even consider to supply a particular value (like we already do with map[string]string{"root": "/"]) - like map[string]string{"rand": ""}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants