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
Add plugin hooks required for the encrypted links plugin #1318
Conversation
9dda74f
to
7f02863
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the biggest point of feedback is let's break these commits up some?
class DeploymentPlugin(Protocol): | ||
def physical_spec( | ||
self, d: Deployment | ||
) -> Dict[str, List[Dict[Tuple[str, ...], Any]]]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should probably give this type a name, like:
MachineSpecs = Dict[str, List[Dict[Tuple[str, ...], Any]]]
or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this type is incredibly awkward, it's so awkward in fact that I don't expect plugin authors to directly type these structures.
Two things I have considered instead:
- Simple dict:
{
"networking": {"hostName": "foobar"}
}
- Abstract away in a class:
spec = Spec()
spec.add_option("networking.hostName", "foobar")
This PR has been rolled up in #1383 |
This is being used by https://github.com/adisbladis/nixops-encrypted-links