This is an automated email from the ASF dual-hosted git repository.

monkeydluffy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new 6278ae018 chore: remove some useless code about kubernetes and tars 
stream discovery (#9926)
6278ae018 is described below

commit 6278ae01839167d943e676ea9b54b3ea4c5cb8d7
Author: Ashing Zheng <[email protected]>
AuthorDate: Fri Aug 4 16:56:06 2023 +0800

    chore: remove some useless code about kubernetes and tars stream discovery 
(#9926)
---
 apisix/discovery/kubernetes/init.lua   | 7 +------
 apisix/discovery/tars/init.lua         | 8 +-------
 docs/en/latest/discovery/kubernetes.md | 6 ------
 docs/zh/latest/discovery/kubernetes.md | 6 ------
 4 files changed, 2 insertions(+), 25 deletions(-)

diff --git a/apisix/discovery/kubernetes/init.lua 
b/apisix/discovery/kubernetes/init.lua
index 3f5f275d9..d16d4f4fc 100644
--- a/apisix/discovery/kubernetes/init.lua
+++ b/apisix/discovery/kubernetes/init.lua
@@ -26,7 +26,7 @@ local error = error
 local pcall = pcall
 local setmetatable = setmetatable
 local is_http = ngx.config.subsystem == "http"
-local support_process, process = pcall(require, "ngx.process")
+local process = require("ngx.process")
 local core = require("apisix.core")
 local util = require("apisix.cli.util")
 local local_conf = require("apisix.core.config_local").local_conf()
@@ -520,11 +520,6 @@ end
 
 
 function _M.init_worker()
-    if not support_process then
-        core.log.error("kubernetes discovery not support in subsystem: ", 
ngx.config.subsystem,
-                       ", please check if your openresty version >= 1.19.9.1 
or not")
-        return
-    end
     local discovery_conf = local_conf.discovery.kubernetes
     core.log.info("kubernetes discovery conf: ", 
core.json.delay_encode(discovery_conf))
     if #discovery_conf == 0 then
diff --git a/apisix/discovery/tars/init.lua b/apisix/discovery/tars/init.lua
index 14f658dce..17bb2758b 100644
--- a/apisix/discovery/tars/init.lua
+++ b/apisix/discovery/tars/init.lua
@@ -23,7 +23,7 @@ local local_conf = 
require("apisix.core.config_local").local_conf()
 local core = require("apisix.core")
 local mysql = require("resty.mysql")
 local is_http = ngx.config.subsystem == "http"
-local support_process, process = pcall(require, "ngx.process")
+local process = require("ngx.process")
 
 local endpoint_dict
 
@@ -343,12 +343,6 @@ local function get_endpoint_dict()
 end
 
 function _M.init_worker()
-    if not support_process then
-        core.log.error("tars discovery not support in subsystem: ", 
ngx.config.subsystem,
-                       ", please check if your openresty version >= 1.19.9.1 
or not")
-        return
-    end
-
     endpoint_dict = get_endpoint_dict()
     if not endpoint_dict then
         error("failed to get lua_shared_dict: tars, please check your APISIX 
version")
diff --git a/docs/en/latest/discovery/kubernetes.md 
b/docs/en/latest/discovery/kubernetes.md
index 0735471b8..fb11aac67 100644
--- a/docs/en/latest/discovery/kubernetes.md
+++ b/docs/en/latest/discovery/kubernetes.md
@@ -34,12 +34,6 @@ The [_Kubernetes_](https://kubernetes.io/) service discovery 
[_List-Watch_](http
 
 Discovery also provides a node query interface in accordance with the [_APISIX 
Discovery Specification_](../discovery.md).
 
-:::note
-
-use kubernetes discovery in L4 require OpenResty version >= 1.19.9.1
-
-:::
-
 ## How To Use
 
 Kubernetes service discovery both support single-cluster and multi-cluster 
modes, applicable to the case where the service is distributed in single or 
multiple Kubernetes clusters.
diff --git a/docs/zh/latest/discovery/kubernetes.md 
b/docs/zh/latest/discovery/kubernetes.md
index 0c390b785..c4b751889 100644
--- a/docs/zh/latest/discovery/kubernetes.md
+++ b/docs/zh/latest/discovery/kubernetes.md
@@ -34,12 +34,6 @@ Kubernetes 服务发现以 
[_List-Watch_](https://kubernetes.io/docs/reference/u
 
 同时遵循 [_APISIX Discovery 规范_](../discovery.md) 提供了节点查询接口。
 
-:::note
-
-在四层中使用 Kubernetes 服务发现要求 OpenResty 版本大于等于 1.19.9.1
-
-:::
-
 ## Kubernetes 服务发现的使用
 
 目前 Kubernetes 服务发现支持单集群和多集群模式,分别适用于待发现的服务分布在单个或多个 Kubernetes 的场景。

Reply via email to