open-policy-agent/frameworks

[local.Driver] Replace PutModules and DeleteModules with AddTemplate and RemoveTemplate

willbeason opened this issue · 2 comments

func (d *Driver) AddTemplate(ct *templates.ConstraintTemplate) error
func (d *Driver) RemoveTemplate(ctx context.Context, ct *template.ConstraintTemplate) error

The driver itself should handle extracting libraries from the ConstraintTemplate and naming them - there's no need for Client to have any of this logic. Having Client not care how code from ConstraintTemplates is compiled is essential for us being able to shard ConstraintTemplates into their own environments under the hood.

For RemoveTemplate - note the inclusion of context.Context since this method will later be responsible for removing the corresponding Constraints.

It's fine to this and #170 as two separate PRs or as one PR - whatever works better for you.

+1

Done!