Skip to content
New issue

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

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

Already on GitHub? # to your account

evalConfig: lazy unchecked eval of nodes #147

Merged
merged 1 commit into from
May 3, 2021

Conversation

fooker
Copy link
Contributor

@fooker fooker commented Apr 10, 2021

The nodes, as exposed through the modules extraArgs are lazy evaluated
by not checking the config. This allows to access other machines
configuration without fully evaluation all configurations an thus
avoiding infinite recursion.

The nodes, as exposed through the modules extraArgs are lazy evaluated
by not checking the config. This allows to access other machines
configuration without fully evaluation all configurations an thus
avoiding infinite recursion.
@srhb
Copy link
Contributor

srhb commented Apr 29, 2021

While I like the general idea and have wished for it several times, I'm a little worried about how big a footgun it might be in reality, so some questions for clarification:

I think that the "other node" (eg. nodes."db01.example.com" as seen from the perspective of web01.example.com in example/simple.nix) is still checked on its own even if we only build web01-- is that correct? What I want to avoid is accidentally referring to a definition that doesn't have a declaration simply because I'm viewing it from an "unchecked perspective"

@fooker
Copy link
Contributor Author

fooker commented Apr 29, 2021

As far as I understand, every nodes config is always evaluated and checked (even if filtered). Speaking in the example above: If one has an invalid option in db01.example.com while calling morph with --on=web01.example.com things will still fail.

@srhb
Copy link
Contributor

srhb commented May 3, 2021

Thanks!

I'm going to go ahead and merge this because I think it's a good idea (and nicer than some alternatives, like a specific ad-hoc "network" module a la NixOS' lib option). I've smoke tested only a few deployments without changes so let's go ahead and see how it works out. :)

@srhb srhb merged commit 91eef43 into DBCDK:master May 3, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants