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

fix: corrupt data in routes() response due to healthchecker data #11844

Merged
merged 16 commits into from
Dec 27, 2024
Merged
7 changes: 7 additions & 0 deletions apisix/control/v1.lua
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,13 @@ local function iter_add_get_routes_info(values, route_id)
if new_route.value.upstream and new_route.value.upstream.parent then
new_route.value.upstream.parent = nil
end
-- remove healthcheck info
nic-6443 marked this conversation as resolved.
Show resolved Hide resolved
new_route.checker = nil
membphis marked this conversation as resolved.
Show resolved Hide resolved
new_route.checker_idx = nil
new_route.checker_upstream = nil
if new_route.clean_handlers then
new_route.clean_handlers = {}
end
Copy link
Member

Choose a reason for hiding this comment

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

why not just also set to nil

Copy link
Contributor Author

Choose a reason for hiding this comment

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

some existing test cases grep logs and expect this to {}

Copy link
Member

Choose a reason for hiding this comment

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

Then you can fix the test case as well.
Checking the logs has no meaning for the control api.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

core.table.insert(infos, new_route)
-- check the route id
if route_id and route.value.id == route_id then
Expand Down
Loading