Skip to content
This repository has been archived by the owner on Jan 17, 2025. It is now read-only.

Reconsider variable name format restrictions #213

Open
achilleas-k opened this issue Sep 23, 2024 · 2 comments
Open

Reconsider variable name format restrictions #213

achilleas-k opened this issue Sep 23, 2024 · 2 comments

Comments

@achilleas-k
Copy link
Member

achilleas-k commented Sep 23, 2024

/usr/bin/cp is an invalid variable name which means we can't have dictionaries under otk.define with keys that include those characters. It also means we can't have dictionaries with keys that start with numbers.

This might become a problem with content hashes used as object keys in defines, which we might need to use at some point.

Originally posted by @achilleas-k in #210 (comment)

@supakeen
Copy link
Member

The same goes with (some) package names as we chatted about a tiny bit in #205.

@mvo5
Copy link
Contributor

mvo5 commented Sep 25, 2024

It seems to me if we want to open this up we probably need to design this a bit more to ensure we are happy with the result.

As a quick strawman: IMHO we should still restrict vars like they are right now, I am worried about confusion from content like ${a-b} if we are too free with the variable names. However we could reconsider the dot notation and allow something like ${a["b-c"]} or ${selinux_labels["/usr/bin/foo"]} or ${packages.versions["my-kernel"]} or ${package.versions[${modifications.kernel}]} - it feels nice but it will be extra work implementing this carefully (and thinking/ensuring we design something that is not painting us into a corner down the line).

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

No branches or pull requests

3 participants