Skip to content

Commit

Permalink
fix(pdk): fix error message in kong.service.set_retries
Browse files Browse the repository at this point in the history
The variable being tested is retries, but the error message refers to
port.
  • Loading branch information
AD7six authored Oct 11, 2024
1 parent 1ae928b commit 4c472c2
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions changelog/unreleased/kong/fix-retries-error-message.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
message: "Fix error message for invalid retries variable"
type: bugfix
scope: PDK
2 changes: 1 addition & 1 deletion kong/pdk/service.lua
Original file line number Diff line number Diff line change
@@ -147,7 +147,7 @@ local function new()
error("retries must be an integer", 2)
end
if retries < 0 or retries > 32767 then
error("port must be an integer between 0 and 32767: given " .. retries, 2)
error("retries must be an integer between 0 and 32767: given " .. retries, 2)
end

local ctx = ngx.ctx
4 changes: 2 additions & 2 deletions t/01-pdk/09-service/04-set-retries.t
Original file line number Diff line number Diff line change
@@ -68,8 +68,8 @@ retries must be an integer
--- request
GET /t
--- response_body
port must be an integer between 0 and 32767: given -1
port must be an integer between 0 and 32767: given 32768
retries must be an integer between 0 and 32767: given -1
retries must be an integer between 0 and 32767: given 32768
--- no_error_log
[error]

1 comment on commit 4c472c2

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

Bazel Build

Docker image available kong/kong:4c472c24d061e7f1a5146b4062c76130a9e60dc2
Artifacts available https://github.com/Kong/kong/actions/runs/11292493935

Please sign in to comment.