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(rds): fix rds signer cannot be used in init phase #50

Merged
merged 2 commits into from
Apr 18, 2023

Conversation

windmgc
Copy link
Member

@windmgc windmgc commented Apr 17, 2023

This PR fixes a problem that the rds signer cannot be used in init phase.

2023/04/17 13:11:45 [error] 784916#0: init_by_lua error: ./kong/globalpatches.lua:576: no request found
stack traceback:
        [C]: in function 'old_tcp'
        ./kong/globalpatches.lua:576: in function 'ngx_socket_tcp'
        ...ee/bazel-bin/build/kong-dev/share/lua/5.1/resty/http.lua:133: in function 'new'
        .../kong-dev/share/lua/5.1/resty/aws/service/rds/signer.lua:9: in main chunk
        [C]: in function 'require'
        ...azel-bin/build/kong-dev/share/lua/5.1/resty/aws/init.lua:467: in function 'RDS'
        ./kong/db/strategies/postgres/iam_token_handler.lua:32: in function 'init'
        ./kong/db/strategies/postgres/connector.lua:1071: in function 'new'
        ./kong/db/strategies/init.lua:37: in function 'new'
        ./kong/db/init.lua:95: in function 'new'
        ./kong/init.lua:624: in function 'init'
        init_by_lua:3: in main chunk

I believe it should because of the new() being called here since I don't really need a real socket in the rds signer. However, to keep consistent with other usages in the repo, I'll replace resty.http with luasockets.http

Tested locally inside Kong's integration.

@windmgc
Copy link
Member Author

windmgc commented Apr 17, 2023

@Tieske Could you please review this? Thanks in advance!

@Tieske
Copy link
Member

Tieske commented Apr 18, 2023

can you add a changelog entry as "unreleased"

Copy link
Member

@Tieske Tieske left a comment

Choose a reason for hiding this comment

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

lgtm. feel free to merge after adding the changelog netry.

@windmgc windmgc merged commit dc01798 into main Apr 18, 2023
@windmgc windmgc deleted the fix-rds-auth-token-init-phase branch April 18, 2023 07:59
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.

None yet

2 participants