Skip to content

Commit

Permalink
feat: release APISIX 3.2.2 (#9723)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlinsRan authored Jul 19, 2023
1 parent 58c1a4c commit 7770483
Show file tree
Hide file tree
Showing 90 changed files with 2,420 additions and 420 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/centos7-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ jobs:
echo "type=last" >>$GITHUB_OUTPUT
fi
- name: Free disk space
run: |
bash ./ci/free_disk_space.sh
- name: Linux launch common services
run: |
make ci-env-up project_compose_ci=ci/pod/docker-compose.common.yml
Expand Down Expand Up @@ -153,8 +157,6 @@ jobs:
- if: ${{ steps.cache-images.outputs.cache-hit != 'true' }}
name: Save docker images
run: |
# free disk space
bash ./ci/free_disk_space.sh
echo "start backing up, $(date)"
bash ./ci/backup-docker-images.sh ${{ steps.test_env.outputs.type }}
echo "backup done, $(date)"
6 changes: 4 additions & 2 deletions .github/workflows/fips.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ jobs:
echo "type=last" >>$GITHUB_OUTPUT
fi
- name: Free disk space
run: |
bash ./ci/free_disk_space.sh
- name: Linux launch common services
run: |
make ci-env-up project_compose_ci=ci/pod/docker-compose.common.yml
Expand Down Expand Up @@ -145,8 +149,6 @@ jobs:
- if: ${{ steps.cache-images.outputs.cache-hit != 'true' }}
name: Save docker images
run: |
# free disk space
bash ./ci/free_disk_space.sh
echo "start backing up, $(date)"
bash ./ci/backup-docker-images.sh ${{ steps.test_env.outputs.type }}
echo "backup done, $(date)"
6 changes: 4 additions & 2 deletions .github/workflows/gm-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ jobs:
echo "type=last" >>$GITHUB_OUTPUT
fi
- name: Free disk space
run: |
bash ./ci/free_disk_space.sh
- name: Linux launch common services
run: |
make ci-env-up project_compose_ci=ci/pod/docker-compose.common.yml
Expand Down Expand Up @@ -160,8 +164,6 @@ jobs:
- if: ${{ steps.cache-images.outputs.cache-hit != 'true' }}
name: Save docker images
run: |
# free disk space
bash ./ci/free_disk_space.sh
echo "start backing up, $(date)"
bash ./ci/backup-docker-images.sh ${{ steps.test_env.outputs.type }}
echo "backup done, $(date)"
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ title: Changelog

## Table of Contents

- [3.2.2](#322)
- [3.2.1](#321)
- [3.2.0](#320)
- [3.1.0](#310)
Expand Down Expand Up @@ -68,6 +69,28 @@ title: Changelog
- [0.7.0](#070)
- [0.6.0](#060)

## 3.2.2

### Bugfix

- Fix the issue where the upstream key cannot be load balanced through `mqtt_client_id` [#9450](https://github.com/apache/apisix/pull/9450)
- Fix `hold_body_chunk` cannot be used in multiple plugins [#9266](https://github.com/apache/apisix/pull/9266)
- Fix domain nodes can cause health check leaks [#9090](https://github.com/apache/apisix/pull/9090)
- The upstream referenced by the traffic-split plugin can be deleted, causing the plugin to fail [#9044](https://github.com/apache/apisix/pull/9044)
- Fix `allow_origins_by_regex` is not nil, and other domain names will also be verified [#9028](https://github.com/apache/apisix/pull/9028)
- When configuring domain names in the traffic-split plugin, they will only be resolved once. [#9332](https://github.com/apache/apisix/pull/9332)
- The syslog plugin has an error in the log encoding format, making the plugin unusable [#9425](https://github.com/apache/apisix/pull/9425)
- Fix `http-logger` is missing the default request path `/`, causing the log push to fail [#9472](https://github.com/apache/apisix/pull/9472)
- When using Wolf-rbac, the consumer cannot use other plugins at the same time [#9298](https://github.com/apache/apisix/pull/9298)
- The incorrect log format of the `splunk-hec-logging` plugin causes the request to fail to be pushed [#9478](https://github.com/apache/apisix/pull/9478)
- Fix `opentelemetry` and `grpc-transcode` plugins cannot be used at the same time [#9606](https://github.com/apache/apisix/pull/9606)
- When adding a header `key: value` in the `response-rewrite` plugin, the value cannot be configured as one character [#9372](https://github.com/apache/apisix/pull/9372)
- Fix etcd enable keepalive [#9420](https://github.com/apache/apisix/pull/9420)
- Use a single long http connection to watch all resources for etcd [#9456](https://github.com/apache/apisix/pull/9456)
- Fix authentication bypass in the jwt-auth plugin [#9837](https://github.com/apache/apisix/pull/9837)
- Fix `update_count` is reset once updated, cause cache key conflict [#9811](https://github.com/apache/apisix/pull/9811)
- Fix(consumer): etcd connection failed during startup and still works [#9077](https://github.com/apache/apisix/pull/9077)

## 3.2.1

### Bugfix
Expand Down
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,6 @@ install: runtime
$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/plugins/serverless
$(ENV_INSTALL) apisix/plugins/serverless/*.lua $(ENV_INST_LUADIR)/apisix/plugins/serverless/

$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/plugins/slslog
$(ENV_INSTALL) apisix/plugins/slslog/*.lua $(ENV_INST_LUADIR)/apisix/plugins/slslog/

$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/plugins/syslog
$(ENV_INSTALL) apisix/plugins/syslog/*.lua $(ENV_INST_LUADIR)/apisix/plugins/syslog/

Expand Down
105 changes: 87 additions & 18 deletions apisix/admin/upstreams.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@
-- limitations under the License.
--
local core = require("apisix.core")
local config_util = require("apisix.core.config_util")
local router = require("apisix.router")
local get_routes = require("apisix.router").http_routes
local get_services = require("apisix.http.service").services
local get_plugin_configs = require("apisix.plugin_config").plugin_configs
local get_consumers = require("apisix.consumer").consumers
local get_consumer_groups = require("apisix.consumer_group").consumer_groups
local apisix_upstream = require("apisix.upstream")
local resource = require("apisix.admin.resource")
local tostring = tostring
local ipairs = ipairs
local type = type


local function check_conf(id, conf, need_id)
Expand All @@ -34,31 +38,96 @@ local function check_conf(id, conf, need_id)
end


local function delete_checker(id)
local routes, routes_ver = get_routes()
if routes_ver and routes then
for _, route in ipairs(routes) do
if type(route) == "table" and route.value
and route.value.upstream_id
and tostring(route.value.upstream_id) == id then
return 400, {error_msg = "can not delete this upstream,"
.. " route [" .. route.value.id
local function up_id_in_plugins(plugins, up_id)
if plugins and plugins["traffic-split"]
and plugins["traffic-split"].rules then

for _, rule in ipairs(plugins["traffic-split"].rules) do
local plugin_upstreams = rule.weighted_upstreams
for _, plugin_upstream in ipairs(plugin_upstreams) do
if plugin_upstream.upstream_id
and tostring(plugin_upstream.upstream_id) == up_id then
return true
end
end
end

return false
end
end


local function check_resources_reference(resources, up_id,
only_check_plugin, resources_name)
if resources then
for _, resource in config_util.iterate_values(resources) do
if resource and resource.value then
if up_id_in_plugins(resource.value.plugins, up_id) then
return {error_msg = "can not delete this upstream,"
.. " plugin in "
.. resources_name .. " ["
.. resource.value.id
.. "] is still using it now"}
end

if not only_check_plugin and resource.value.upstream_id
and tostring(resource.value.upstream_id) == up_id then
return {error_msg = "can not delete this upstream, "
.. resources_name .. " [" .. resource.value.id
.. "] is still using it now"}
end
end
end
end
end


local function delete_checker(id)
local routes = get_routes()
local err_msg = check_resources_reference(routes, id, false, "route")
if err_msg then
return 400, err_msg
end

local services, services_ver = get_services()
core.log.info("services: ", core.json.delay_encode(services, true))
core.log.info("services_ver: ", services_ver)
if services_ver and services then
for _, service in ipairs(services) do
if type(service) == "table" and service.value
and service.value.upstream_id
and tostring(service.value.upstream_id) == id then
return 400, {error_msg = "can not delete this upstream,"
.. " service [" .. service.value.id
.. "] is still using it now"}
local err_msg = check_resources_reference(services, id, false, "service")
if err_msg then
return 400, err_msg
end

local plugin_configs = get_plugin_configs()
local err_msg = check_resources_reference(plugin_configs, id, true, "plugin_config")
if err_msg then
return 400, err_msg
end

local consumers = get_consumers()
local err_msg = check_resources_reference(consumers, id, true, "consumer")
if err_msg then
return 400, err_msg
end

local consumer_groups = get_consumer_groups()
local err_msg = check_resources_reference(consumer_groups, id, true, "consumer_group")
if err_msg then
return 400, err_msg
end

-- TODO: Refactor router.global_rules and then refactor the following code
local global_rules = router.global_rules
if global_rules and global_rules.values
and #global_rules.values > 0 then

for _, global_rule in config_util.iterate_values(global_rules.values) do
if global_rule and global_rule.value
and global_rule.value.plugins
and up_id_in_plugins(global_rule.value.plugins, id) then
return 400, {error_msg = "can not delete this upstream,"
.. " plugin in global_rule ["
.. global_rule.value.id
.. "] is still using it now"}
end
end
end
Expand Down
3 changes: 3 additions & 0 deletions apisix/cli/snippet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ upstream apisix_conf_backend {
local conf_server = require("apisix.conf_server")
conf_server.balancer()
}
keepalive 320;
keepalive_requests 1000;
keepalive_timeout 60s;
}
{% if trusted_ca_cert then %}
Expand Down
3 changes: 1 addition & 2 deletions apisix/consumer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,12 @@ end

function _M.init_worker()
local err
local config = core.config.new()
local cfg = {
automatic = true,
item_schema = core.schema.consumer,
checker = check_consumer,
}
if config.type ~= "etcd" then
if core.config.type ~= "etcd" then
cfg.filter = filter
end

Expand Down
8 changes: 8 additions & 0 deletions apisix/consumer_group.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ function _M.init_worker()
end


function _M.consumer_groups()
if not consumer_groups then
return nil, nil
end
return consumer_groups.values, consumer_groups.conf_version
end


function _M.get(id)
return consumer_groups:get(id)
end
Expand Down
Loading

0 comments on commit 7770483

Please sign in to comment.