fix(cmd): lack of necessary nginx directives in kong cli nginx.conf
Summary
This is an alternative of #10675. The primary logic keeps the same, but the inject logic is further moved forward from kong/cmd/init.lua to bin/kong so that the execution flow won't enter kong/cmd/init.lua twice.
We still keep the bin/kong a resty script because many files such as kong.conf_loader, kong.cmd.utils.process_secrets rely on ngx. If we change bin/kong into a pure lua or other language script, we need to rewrite the conf_loader and compile part logic.
Checklist
- [x] The Pull Request has tests
- [x] There's an entry in the CHANGELOG
detach the "drop luasocket in cli" part to a separate PR so that this PR is easier to review. Also because these two PRs are relatively logically independent.
Is this needed for 3.4 (it's in the milestone)?
Is this needed for 3.4 (it's in the milestone)?
@kikito Yes, I think so. it was moved from 3.3 to 3.4 because of pursuing a more generic approach.
We, @kikito, @jschmid1, and @bungle, decided to move this to 3.4. This is a rather generic problem, and we would like to pursue different approaches before committing to this. Approaches that might work in more generic fashion are:
The backport to release/3.3.x failed:
The process '/usr/bin/git' failed with exit code 1
To backport manually, run these commands in your terminal:
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release/3.3.x release/3.3.x
# Navigate to the new working tree
cd .worktrees/backport-release/3.3.x
# Create a new branch
git switch --create backport-11127-to-release/3.3.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 8a1ebba055d28f940cc19774cf5edf35f71dd149
# Push it to GitHub
git push --set-upstream origin backport-11127-to-release/3.3.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release/3.3.x
Then, create a pull request where the base branch is release/3.3.x and the compare/head branch is backport-11127-to-release/3.3.x.
Backporting this to 3.3 since it seems this is needed in https://github.com/Kong/kong/pull/11210 (failing test complains about missing inject_confs file)