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

Update Javadoc for Deletable.delete() #6778

Open
manusa opened this issue Jan 10, 2025 · 1 comment
Open

Update Javadoc for Deletable.delete() #6778

manusa opened this issue Jan 10, 2025 · 1 comment

Comments

@manusa
Copy link
Member

manusa commented Jan 10, 2025

          > The Javadoc for `Deletable` contain:

It is not guaranteed that the returned list will contain all values marked for deletion - see Issue #3058

It's not clear if this issue was fixed (in which case the above text should be removed from the Javadoc), or what the list can/will contain if this is not the case... Can you please elaborate? Thank you.

OK, so this Javadoc is a little bit unclear and probably outdated.

Its verbosity is mostly because there was a change in the method return type (from boolean to the List<StatusDetails>) some time ago.
Users were relying on the boolean response to assert that a resource was actually deleted.

However, there is no guarantee (from the Kubernetes API server) that a resource will be deleted if a DELETE request is performed against such resource.

In order to make sure that a resource is deleted, you need to check that it's marked for deletion (has a deletionTimestamp) and that all the finalizers have been cleared.
Eventually, the resource will be deleted.

To ensure that a resource is deleted you'd need a further check such as:

client.pods().withName($name).waitUntilCondition(Objects::isNull, 60, TimeUnit.SECONDS);

client.pods().withName($name).withTimeout(60, TimeUnit.SECONDS).delete();

We can probably remove the reference to this PR and add a few extra tips to the Javadoc.

/cc @shawkins

Originally posted by @manusa in #3058 (comment)

@manusa
Copy link
Member Author

manusa commented Jan 13, 2025

#3058 (comment)

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