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

[local.Driver] Add methods AddConstraint and RemoveConstraint #170

Closed
willbeason opened this issue Dec 16, 2021 · 1 comment
Closed

[local.Driver] Add methods AddConstraint and RemoveConstraint #170

willbeason opened this issue Dec 16, 2021 · 1 comment

Comments

@willbeason
Copy link
Member

willbeason commented Dec 16, 2021

Should be done either after or concurrently with #171

Use these signatures:

func (d *Driver) AddConstraint(ctx context.Context, target string, constraint *unstructured.Unstructured) error

func (d *Driver) RemoveConstraint(ctx context.Context, target string, constraint *unstructured.Unstructured) error

Note that relpath is not specified by Client - this logic needs to move to Driver as Client should not care about how Driver is organizing Constraints. So createConstraintPath() logic should be moved to the Driver. Note that AddConstraint should probably still call PutData for the required database transaction. And similar for RemoveConstraint - which should use DeleteData.

@willbeason willbeason added this to the Rego Environment Sharding milestone Dec 16, 2021
becky-hd added a commit to becky-hd/frameworks that referenced this issue Jan 14, 2022
becky-hd added a commit to becky-hd/frameworks that referenced this issue Jan 21, 2022
)

Signed-off-by: Becky Huang <beckyhd@google.com>
becky-hd added a commit to becky-hd/frameworks that referenced this issue Jan 22, 2022
Signed-off-by: Becky Huang <beckyhd@google.com>
becky-hd added a commit to becky-hd/frameworks that referenced this issue Jan 22, 2022
becky-hd added a commit to becky-hd/frameworks that referenced this issue Jan 25, 2022
)

Signed-off-by: Becky Huang <beckyhd@google.com>
becky-hd added a commit to becky-hd/frameworks that referenced this issue Jan 25, 2022
)

Signed-off-by: Becky Huang <beckyhd@google.com>
becky-hd added a commit to becky-hd/frameworks that referenced this issue Jan 25, 2022
Signed-off-by: Becky Huang <beckyhd@google.com>
becky-hd added a commit to becky-hd/frameworks that referenced this issue Jan 25, 2022
becky-hd added a commit to becky-hd/frameworks that referenced this issue Jan 25, 2022
becky-hd added a commit to becky-hd/frameworks that referenced this issue Feb 2, 2022
)

Signed-off-by: Becky Huang <beckyhd@google.com>
becky-hd added a commit to becky-hd/frameworks that referenced this issue Feb 2, 2022
)

Signed-off-by: Becky Huang <beckyhd@google.com>
becky-hd added a commit to becky-hd/frameworks that referenced this issue Feb 2, 2022
Signed-off-by: Becky Huang <beckyhd@google.com>
becky-hd added a commit to becky-hd/frameworks that referenced this issue Feb 2, 2022
becky-hd added a commit to becky-hd/frameworks that referenced this issue Feb 2, 2022
willbeason pushed a commit that referenced this issue Feb 4, 2022
* provide driver AddConstraint and RemoveConstraint (#170)

Signed-off-by: Becky Huang <beckyhd@google.com>

* unit tests for Driver.AddConstraint (#170)

Signed-off-by: Becky Huang <beckyhd@google.com>

* No error returns for removing a non-matching constraint (#170)

Signed-off-by: Becky Huang <beckyhd@google.com>

* provide driver AddConstraint and RemoveConstraint (#170)

Signed-off-by: Becky Huang <beckyhd@google.com>

* provide driver AddConstraint and RemoveConstraint (#170)

Signed-off-by: Becky Huang <beckyhd@google.com>

* unit tests for Driver.AddConstraint (#170)

Signed-off-by: Becky Huang <beckyhd@google.com>

* No error returns for removing a non-matching constraint (#170)

Signed-off-by: Becky Huang <beckyhd@google.com>

* Protect d.templateHandler read/write/delete with mutex, fix test(#170)

Signed-off-by: Becky Huang <beckyhd@google.com>

* gvk group check for constraint

Signed-off-by: Becky Huang <beckyhd@google.com>

* provide driver AddConstraint and RemoveConstraint (#170)

Signed-off-by: Becky Huang <beckyhd@google.com>

* provide driver AddConstraint and RemoveConstraint (#170)

Signed-off-by: Becky Huang <beckyhd@google.com>

* unit tests for Driver.AddConstraint (#170)

Signed-off-by: Becky Huang <beckyhd@google.com>

* No error returns for removing a non-matching constraint (#170)

Signed-off-by: Becky Huang <beckyhd@google.com>

* Protect d.templateHandler read/write/delete with mutex, fix test(#170)

Signed-off-by: Becky Huang <beckyhd@google.com>

* gvk group check for constraint

Signed-off-by: Becky Huang <beckyhd@google.com>

Co-authored-by: Will Beason <willbeason@google.com>
@willbeason
Copy link
Member Author

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant