open-policy-agent/frameworks

Remove UpsertPolicy/DeletePolicy from local.driver.altermodules

willbeason opened this issue · 2 comments

File: constraint/pkg/client/drivers/local/local.go

We've determined these checks aren't necessary, so they just clutter up the code. Remove this behavior.

This also means we can remove .WithPathConflictsCheck(storage.NonEmpty(ctx, d.storage, txn)), and all calls which relate to the storage transaction in altermodules.

The tests that fail should be mocking Storage to fail on these calls - there isn't a way to execute the error paths naturally. If a non-storage-mocking test fails, then we might need to keep them for now. (Reach out to willbeason@ - this would be very surprising)

Also remove ast.CheckPathConflicts since there isn't any way this can fail (if you do manage to make it fail without mocking storage, add a test that showcases this behavior).

I can take this on.

Done!