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

api: Return 404 when deregistering a non-existent check #11950

Merged
merged 2 commits into from
Jan 6, 2022

Conversation

blake
Copy link
Member

@blake blake commented Jan 5, 2022

Update the /agent/check/deregister/ API endpoint to return a 404 HTTP response code when an attempt is made to de-register a check ID that does not exist on the agent.

This brings the behavior of /agent/check/deregister/ inline with the behavior of /agent/service/deregister/ which was changed in #10632 to similarly return a 404 when de-registering non-existent services.

Fixes #5821

@blake blake added the theme/api Relating to the HTTP API interface label Jan 5, 2022
@blake blake requested a review from a team January 5, 2022 22:17
@blake blake self-assigned this Jan 5, 2022
@github-actions github-actions bot removed the theme/api Relating to the HTTP API interface label Jan 5, 2022
@blake blake force-pushed the blake/api-404-deregister-non-existent-check branch from e4e5a06 to 5672e56 Compare January 5, 2022 23:49
@vercel vercel bot temporarily deployed to Preview – consul January 5, 2022 23:49 Inactive
@vercel vercel bot temporarily deployed to Preview – consul-ui-staging January 5, 2022 23:49 Inactive
@blake blake force-pushed the blake/api-404-deregister-non-existent-check branch from 5672e56 to 7b5db25 Compare January 6, 2022 00:12
@vercel vercel bot temporarily deployed to Preview – consul January 6, 2022 00:12 Inactive
@vercel vercel bot temporarily deployed to Preview – consul-ui-staging January 6, 2022 00:12 Inactive
Update the `/agent/check/deregister/` API endpoint to return a 404
HTTP response code when an attempt is made to de-register a check ID
that does not exist on the agent.

This brings the behavior of /agent/check/deregister/ inline with the
behavior of /agent/service/deregister/ which was changed in #10632 to
similarly return a 404 when de-registering non-existent services.

Fixes #5821
@blake blake force-pushed the blake/api-404-deregister-non-existent-check branch from 7b5db25 to 0636516 Compare January 6, 2022 19:38
@vercel vercel bot temporarily deployed to Preview – consul-ui-staging January 6, 2022 19:38 Inactive
@vercel vercel bot temporarily deployed to Preview – consul January 6, 2022 19:38 Inactive
Copy link
Contributor

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

Nice, thanks for fixing this!

@blake blake merged commit 4bd9292 into main Jan 6, 2022
@blake blake deleted the blake/api-404-deregister-non-existent-check branch January 6, 2022 20:38
@hc-github-team-consul-core
Copy link
Contributor

🍒 If backport labels were added before merging, cherry-picking will start automatically.

To retroactively trigger a backport after merging, add backport labels and re-run https://circleci.com/gh/hashicorp/consul/542465.

@hc-github-team-consul-core
Copy link
Contributor

🍒❌ Cherry pick of commit 4bd9292 onto release/1.11.x failed! Build Log

blake added a commit that referenced this pull request Jan 6, 2022
Update the `/agent/check/deregister/` API endpoint to return a 404
HTTP response code when an attempt is made to de-register a check ID
that does not exist on the agent.

This brings the behavior of /agent/check/deregister/ in line with the
behavior of /agent/service/deregister/ which was changed in #10632 to
similarly return a 404 when de-registering non-existent services.

Fixes #5821
blake added a commit that referenced this pull request Jan 11, 2022
Update the `/agent/check/deregister/` API endpoint to return a 404
HTTP response code when an attempt is made to de-register a check ID
that does not exist on the agent.

This brings the behavior of /agent/check/deregister/ in line with the
behavior of /agent/service/deregister/ which was changed in #10632 to
similarly return a 404 when de-registering non-existent services.

Fixes #5821
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.

HTTP 500 when deregistering nonexistent check with ACLs enabled
4 participants