fix: etcd sync data checker should work #11457
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: ashing [email protected]
Description
Fixes #11216
fix part 2 of this issue
Background
the
load_full_data
function in the fileconfig_etcd.lua
(load all exist data from etcd when apisix start),checker
does not depend onitem_schema
to have a valueapisix/apisix/core/config_etcd.lua
Lines 540 to 546 in 507df12
But in the
sync_data
function (watch new events from etcd when apisix running),checker
relies onitem_schema
should have value.apisix/apisix/core/config_etcd.lua
Line 668 in 507df12
As a result, the plugin metadata resource cannot reach the checker logic when etcd watch.
apisix/apisix/plugin.lua
Lines 816 to 821 in 507df12
So we need to fix it.
about the test case:
The admin api is not used for the operation, because the admin api will directly fail to verify the schema and cannot go to the etcd checker logic.
error-log-logger-clickhouse.t: The request header sent to clickhouse should be decrypted to be correct.
There was a problem with the previous modification of this PR
https://github.com/apache/apisix/pull/11076/files#diff-2974594095136be865db5d415f3da92d2a435211e30f93f693f1ed46a4a90037
PS: This PR is a partial fork of #11430.
about failed CI
My PR changes have nothing to do with this CI error. The reason for the error is a problem with the image version used by the github runner.
ref: https://github.com/apache/apisix/actions/runs/10193727573/job/28202213850?pr=11457
ref: https://github.com/apache/apisix/actions/runs/10193727573/job/28202215238?pr=11457
Checklist