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

adisbladis commented Apr 23, 2020

@adisbladis adisbladis force-pushed the adisbladis:plugin-hooks branch from 9dda74f to 7f02863 Apr 23, 2020
@grahamc grahamc added this to In progress in kanban Apr 24, 2020
nixops/backends/__init__.py Outdated Show resolved Hide resolved
nixops/plugins/enums.py Outdated Show resolved Hide resolved
Copy link
Member

grahamc left a comment

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]]]:

This comment has been minimized.

@grahamc

grahamc Apr 24, 2020 Member

I think we should probably give this type a name, like:

MachineSpecs = Dict[str, List[Dict[Tuple[str, ...], Any]]]

or something?

This comment has been minimized.

@adisbladis

adisbladis May 15, 2020 Author Member

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 adisbladis force-pushed the adisbladis:plugin-hooks branch from 7f02863 to 4038f8e May 14, 2020
@adisbladis adisbladis force-pushed the adisbladis:plugin-hooks branch from 4038f8e to e85e40d Jun 12, 2020
adisbladis added 8 commits Jun 12, 2020
@adisbladis adisbladis force-pushed the adisbladis:plugin-hooks branch from e85e40d to ca02081 Jun 12, 2020
@adisbladis
Copy link
Member Author

adisbladis commented Jul 8, 2020

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
Projects
kanban
  
Done
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.