Skip to content

internal/rest/resources/cluster: Return 404 when member is not found - #752

Merged
roosterfish merged 1 commit into
canonical:v4from
claudiubelu:v4-return-404-member-not-found
Jun 11, 2026
Merged

internal/rest/resources/cluster: Return 404 when member is not found#752
roosterfish merged 1 commit into
canonical:v4from
claudiubelu:v4-return-404-member-not-found

Conversation

@claudiubelu

Copy link
Copy Markdown
Contributor

clusterMemberDelete is returning a SmartError when the given member is absent from the truststore. This makes it difficult for callers to distinguish "not found" from a real internal error.

Switch to NotFound error, so callers can use IsNotFoundError to treat an already-absent member as a success.

@roosterfish roosterfish left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good catch.

I see you have also opened up two more PRs for v3 and v2. Please make sure those commits are picked using git cherry-pick -x to keep the history from where the changes are coming from.

Comment thread internal/rest/resources/cluster.go Outdated
@claudiubelu
claudiubelu force-pushed the v4-return-404-member-not-found branch from b19a744 to 031b427 Compare June 11, 2026 10:30
…rors

clusterMemberDelete is returning a SmartError when the given member is absent
from the truststore. This makes it difficult for callers to distinguish "not found"
from a real internal error.

Switch to NotFound error, so callers can use IsNotFoundError to treat an
already-absent member as a success.

Additionally switched other client-related errors into BadRequest.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
@claudiubelu
claudiubelu force-pushed the v4-return-404-member-not-found branch from 031b427 to b1b192d Compare June 11, 2026 11:43

@roosterfish roosterfish left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@roosterfish
roosterfish merged commit 71125aa into canonical:v4 Jun 11, 2026
7 checks passed
@claudiubelu

Copy link
Copy Markdown
Contributor Author

Thanks, good catch.

I see you have also opened up two more PRs for v3 and v2. Please make sure those commits are picked using git cherry-pick -x to keep the history from where the changes are coming from.

I've updated those branches as well, applying the same fixes to them via cherry-pick -x.

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

Successfully merging this pull request may close these issues.

2 participants