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

Add plugin hooks required for the encrypted links plugin #1318

Closed
wants to merge 8 commits into from

Conversation

adisbladis
Copy link
Member

nixops/plugins/enums.py Outdated Show resolved Hide resolved
Copy link
Member

@grahamc grahamc left a 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?

nixops/deployment.py Outdated Show resolved Hide resolved
nixops/deployment.py Show resolved Hide resolved
class DeploymentPlugin(Protocol):
def physical_spec(
self, d: Deployment
) -> Dict[str, List[Dict[Tuple[str, ...], Any]]]:
Copy link
Member

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?

Copy link
Member Author

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")

nixops/plugins/enums.py Outdated Show resolved Hide resolved
nixops/util.py Outdated Show resolved Hide resolved
@adisbladis
Copy link
Member Author

This PR has been rolled up in #1383

@adisbladis adisbladis closed this Jul 8, 2020
kanban automation moved this from In progress to Done Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
kanban
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants