feat: add plugin config#3567
Merged
Merged
Conversation
spacewander
force-pushed
the
plugin_config
branch
2 times, most recently
from
February 10, 2021 09:55
f94bdd7 to
b3a6f79
Compare
fix apache#3532 Signed-off-by: spacewander <[email protected]>
spacewander
force-pushed
the
plugin_config
branch
from
February 10, 2021 10:30
b3a6f79 to
4bc2eea
Compare
spacewander
marked this pull request as ready for review
February 10, 2021 10:30
membphis
approved these changes
Feb 20, 2021
| "/plugins", "/consumers", "/node_status", | ||
| "/ssl", "/global_rules", "/stream_routes", | ||
| "/proto", "/plugin_metadata"}) do | ||
| "/proto", "/plugin_metadata", "/plugin_configs"}) do |
Member
There was a problem hiding this comment.
Is it possible to move this logic to the init_by_lua phase in the future?
Member
Author
There was a problem hiding this comment.
After we can sync etcd data in that phase.
| local enable_websocket = route.value.enable_websocket | ||
|
|
||
| if route.value.plugin_config_id then | ||
| local pc = plugin_config.get(route.value.plugin_config_id) |
|
|
||
|
|
||
| function _M.merge(route_conf, plugin_config) | ||
| if route_conf.prev_plugin_config_ver ~= plugin_config.modifiedIndex then |
Member
There was a problem hiding this comment.
another code style:
if route_conf.prev_plugin_config_ver == plugin_config.modifiedIndex then
return route_conf
end
...| type = "object", | ||
| properties = { | ||
| id = id_schema, | ||
| desc = {type = "string", maxLength = 256}, |
Member
There was a problem hiding this comment.
all of the desc should be the same, declare it as a variable and just quote it
Member
Author
There was a problem hiding this comment.
Will do it in the next PR.
Signed-off-by: spacewander <[email protected]>
Signed-off-by: spacewander <[email protected]>
tokers
reviewed
Feb 20, 2021
| local key = "/plugin_configs/" .. id | ||
| local res, err = core.etcd.delete(key) | ||
| if not res then | ||
| core.log.error("failed to delete global rule[", key, "]: ", err) |
Contributor
There was a problem hiding this comment.
Typo: should be "failed to delete plugin_config"
Signed-off-by: spacewander <[email protected]>
tokers
approved these changes
Feb 20, 2021
Member
|
merged, many thx |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix #3532
Signed-off-by: spacewander [email protected]
What this PR does / why we need it:
Pre-submission checklist: