Skip to content

Commit

Permalink
Do not set object.raw on delete (#471)
Browse files Browse the repository at this point in the history
  • Loading branch information
jumpojoy authored Aug 27, 2024
1 parent 311bf9c commit ff5fad5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kr8s/_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ async def delete(self, propagation_policy: str | None = None) -> None:
url=f"{self.endpoint}/{self.name}",
namespace=self.namespace,
data=json.dumps(data),
) as resp:
self.raw = resp.json()
):
pass
except ServerError as e:
if e.response and e.response.status_code == 404:
raise NotFoundError(
Expand Down
9 changes: 9 additions & 0 deletions kr8s/tests/test_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,15 @@ async def test_secret_data(ns):
await secret.delete()


async def test_secret_create_delete_not_changed(ns):
[secret] = await objects_from_files(CURRENT_DIR / "resources" / "secret.yaml")
secret.namespace = ns
await secret.create()
await secret.delete()
exists = await secret.exists()
assert not exists


async def test_validate_pod(example_pod_spec):
kubernetes_validate = pytest.importorskip("kubernetes_validate")
pod = await Pod(example_pod_spec)
Expand Down

0 comments on commit ff5fad5

Please sign in to comment.