Skip to content

Commit

Permalink
fix: Remove TwingateResourceAccess ownerReference (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekampf committed May 16, 2024
1 parent 2f856a6 commit acf0a72
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
3 changes: 0 additions & 3 deletions app/handlers/handlers_resource_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ def twingate_resource_access_change(body, spec, memo, logger, patch, status, **k
reason="Success",
message=f"Added access to {resource_crd.spec.id}<>{principal_id}",
)
patch.metadata["ownerReferences"] = [
resource_crd.metadata.owner_reference_object
]
return success(principal_id=principal_id, resource_id=resource_id)
except GraphQLMutationError as mex:
kopf.exception(
Expand Down
9 changes: 0 additions & 9 deletions app/handlers/tests/test_handlers_resource_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ def test_create_success(self, resource_factory, kopf_info_mock, mock_api_client)
memo_mock = MagicMock()
patch_mock = MagicMock()
patch_mock.metadata = {}
patch_mock.metadata["ownerReferences"] = []

resource_crd_mock = MagicMock()
resource_crd_mock.spec = resource_spec
Expand All @@ -145,14 +144,6 @@ def test_create_success(self, resource_factory, kopf_info_mock, mock_api_client)
}

kopf_info_mock.assert_called_once_with("", reason="Success", message=ANY)
assert patch_mock.metadata["ownerReferences"] == [
{
"apiVersion": "twingate.com/v1",
"kind": "TwingateResource",
"name": "foo",
"uid": "uid",
}
]

def test_create_invalid_ref(self, mock_api_client):
resource_access_spec = {
Expand Down

0 comments on commit acf0a72

Please sign in to comment.