nic-6443 commented on code in PR #12241: URL: https://github.com/apache/apisix/pull/12241#discussion_r2135427980
########## apisix/core/etcd.lua: ########## @@ -37,6 +39,81 @@ local ngx_get_phase = ngx.get_phase local _M = {} +local NOT_ALLOW_WRITE_ETCD_WARN = 'Data plane role should not write to etcd. ' .. + 'This operation will be deprecated in future releases.' + +local function is_data_plane() + local local_conf, err = fetch_local_conf() + if not local_conf then + return nil, err + end + + local role = try_read_attr(local_conf, "deployment", "role") + if role == "data_plane" then + return true + end + + return false +end + + + +local function block_write_if_data_plane() Review Comment: block is not a good name in here. block is often used to indicate IO blocking, such as: `blocking io` and `non-blocking io`. `block_write` has a significant ambiguity with the actual function of this function. It is recommended to change it to `disable`, etc. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org