[GitHub] [apisix-dashboard] membphis commented on pull request #972: test: e2e test balancer (roundrobin upstream)

2020-12-07 Thread GitBox


membphis commented on pull request #972:
URL: https://github.com/apache/apisix-dashboard/pull/972#issuecomment-740452384


   no related issue?



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on issue #2985: bug: 'limit-conn' plugin seems working in an unexpected manner

2020-12-07 Thread GitBox


membphis commented on issue #2985:
URL: https://github.com/apache/apisix/issues/2985#issuecomment-740451592


   fixed the conflict right now ^_^



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on pull request #2465: bugfix(limit-conn): always save the data of the limit object, and release it in log phase.

2020-12-07 Thread GitBox


membphis commented on pull request #2465:
URL: https://github.com/apache/apisix/pull/2465#issuecomment-740451408


   @tokers @moonming @spacewander  I have fixed the conflict, you can take a 
look



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] JanLi-air opened a new issue #2992: request help: configure multiple servers in apisix

2020-12-07 Thread GitBox


JanLi-air opened a new issue #2992:
URL: https://github.com/apache/apisix/issues/2992


   ### Issue description
   APISIX can be much more multi-functional if it can support configuring 
multiple servers.
   For example, if we want to use APISIX to support 3 kinds of requests:
   1. normal http and https
   2. http and https with proxy protocol
   3. https with mtls
   
   Although all the 3 kinds of requests use http or https, the real protocol 
has subtle difference.
   
   Currently APISIX can configure one server with both http, https, http with 
proxy protocl, and https with proxy protocol.
   But there are two issues:
   1. You cannot configure both normal https and https-mtls in the same server.
   2. The real_ip_header needs to be configured differently between http/https 
proxy protol and normal http/https.
   
   So I think APISIX needs to way to configure multi-servers to make APISIX 
more versatile.
   
   ### Environment
   
   * apisix version (cmd: `apisix version`): 2.0
   * OS: Linux
   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[apisix-ingress-controller] branch kv/docs updated (d3a87af -> 595940e)

2020-12-07 Thread kvn
This is an automated email from the ASF dual-hosted git repository.

kvn pushed a change to branch kv/docs
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git.


from d3a87af  doc: add git ignore
 add 595940e  doc: add hyperlink for todos

No new revisions were added by this update.

Summary of changes:
 README.md | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)



[GitHub] [apisix] Fuchange commented on issue #2161: bug: After the 1.5Rpm package was installed in centos7.6(ARM64), an error was occurred

2020-12-07 Thread GitBox


Fuchange commented on issue #2161:
URL: https://github.com/apache/apisix/issues/2161#issuecomment-740444230


   when I build apisix-2.1 rpm package and run at openEuler 20.09 on ARM , I 
got the same erro.
   
   This is because the file is builded on x86_ 64 system .(The path is 
different because I use lua 5.3 .)
   
   ```bash
   # file /usr/local/apisix//deps/lib/lua/5.3/lfs.so
   /usr/local/apisix//deps/lib/lua/5.3/lfs.so: ELF 64-bit LSB shared object, 
x86-64, version 1 (SYSV), dynamically linked, 
BuildID[sha1]=d4d35b43c6d757f2ff09619b75eae20bdbea78bd, not stripped
   ```
   I think it's a bug for 
[build-tools/run.sh](https://github.com/api7/build-tools/blob/master/run.sh) , 
   
   you can fix it temporary by run cmd: `yum install lua-filesystem` to 
overwrite it.
   
   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] idbeta edited a comment on pull request #972: test: e2e test balancer (roundrobin upstream)

2020-12-07 Thread GitBox


idbeta edited a comment on pull request #972:
URL: https://github.com/apache/apisix-dashboard/pull/972#issuecomment-740443960


   @nic-chen when you are free, please help check the reason for this E2E 
failure. 
https://github.com/apache/apisix-dashboard/pull/972/checks?check_run_id=1515573556



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] idbeta commented on pull request #972: test: e2e test balancer (roundrobin upstream)

2020-12-07 Thread GitBox


idbeta commented on pull request #972:
URL: https://github.com/apache/apisix-dashboard/pull/972#issuecomment-740443960


   @nic-chen when you are free, please help check the reason for this E2E 
failure.



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-ingress-controller] gxthrj commented on a change in pull request #48: docs: add usage/design/install/contribute/FAQ docs & modify README

2020-12-07 Thread GitBox


gxthrj commented on a change in pull request #48:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/48#discussion_r538103398



##
File path: samples/deploy/rbac/apisix_view_clusterrolebinding.yaml
##
@@ -8,5 +8,4 @@ roleRef:
   name: apisix-view-clusterrole
 subjects:
 - kind: ServiceAccount
-  name: apisix-view-serviceaccount
-  namespace: cloud
\ No newline at end of file
+  name: apisix-view-serviceaccount

Review comment:
   done

##
File path: samples/deploy/rbac/service_account.yaml
##
@@ -2,4 +2,4 @@ apiVersion: v1
 kind: ServiceAccount
 metadata:
   name: apisix-view-serviceaccount
-  namespace: cloud
\ No newline at end of file
+  

Review comment:
   done





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] souzens opened a new issue #985: feat re: active check support custom port

2020-12-07 Thread GitBox


souzens opened a new issue #985:
URL: https://github.com/apache/apisix-dashboard/issues/985


   apisix's feature:
   active.port: The customize health check host port (optional), this will 
override the port in the upstream node.
   
   but apisix-dashboard do not support now.
   
   LIke:
   
![image](https://user-images.githubusercontent.com/35559209/101454185-81fc1f80-396b-11eb-8f21-9fce0ef82d6e.png)
   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[apisix-ingress-controller] branch kv/docs updated (b41747b -> d3a87af)

2020-12-07 Thread kvn
This is an automated email from the ASF dual-hosted git repository.

kvn pushed a change to branch kv/docs
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git.


from b41747b  fix: rm .DS_Store
 add d3a87af  doc: add git ignore

No new revisions were added by this update.

Summary of changes:
 .gitignore | 1 +
 1 file changed, 1 insertion(+)



[apisix-ingress-controller] branch kv/docs updated (4c806b1 -> b41747b)

2020-12-07 Thread kvn
This is an automated email from the ASF dual-hosted git repository.

kvn pushed a change to branch kv/docs
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git.


from 4c806b1  doc: add architecture image
 add b41747b  fix: rm .DS_Store

No new revisions were added by this update.

Summary of changes:
 .DS_Store  | Bin 6148 -> 0 bytes
 .gitignore |   1 -
 2 files changed, 1 deletion(-)
 delete mode 100644 .DS_Store



[GitHub] [apisix] membphis commented on issue #2962: help~! 如何将 Kong已有业务平滑迁移至 apisix 解决方案?

2020-12-07 Thread GitBox


membphis commented on issue #2962:
URL: https://github.com/apache/apisix/issues/2962#issuecomment-740440759


   If you are interested in this topic, welcome to discuss this issue.



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[apisix-ingress-controller] branch kv/docs updated (a011e1c -> 4c806b1)

2020-12-07 Thread kvn
This is an automated email from the ASF dual-hosted git repository.

kvn pushed a change to branch kv/docs
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git.


from a011e1c  doc: modify desc
 add 4c806b1  doc: add architecture image

No new revisions were added by this update.

Summary of changes:
 README.md|   8 ++--
 docs/images/module-0.png | Bin 0 -> 377084 bytes
 2 files changed, 6 insertions(+), 2 deletions(-)
 create mode 100644 docs/images/module-0.png



[GitHub] [apisix] spacewander commented on issue #2985: bug: 'limit-conn' plugin seems working in an unexpected manner

2020-12-07 Thread GitBox


spacewander commented on issue #2985:
URL: https://github.com/apache/apisix/issues/2985#issuecomment-740438612


   Good to know. BTW, it is @membphis 's modifications.
   @membphis 
   Would you solve the conflict in #2465 ?



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[apisix-ingress-controller] branch kv/docs updated (a2f7a66 -> a011e1c)

2020-12-07 Thread kvn
This is an automated email from the ASF dual-hosted git repository.

kvn pushed a change to branch kv/docs
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git.


from a2f7a66  doc: modify desc
 add f7224c4  doc: add EOL
 add a011e1c  doc: modify desc

No new revisions were added by this update.

Summary of changes:
 README.md| 20 ++--
 samples/deploy/rbac/apisix_view_clusterrole.yaml |  3 ++-
 .../deploy/rbac/apisix_view_clusterrolebinding.yaml  |  3 ++-
 samples/deploy/rbac/service_account.yaml |  1 -
 4 files changed, 14 insertions(+), 13 deletions(-)



[GitHub] [apisix-ingress-controller] tokers opened a new issue #62: use zapcore to encapsulate a log package

2020-12-07 Thread GitBox


tokers opened a new issue #62:
URL: https://github.com/apache/apisix-ingress-controller/issues/62


   We need a good log package, which must contains the following features:
   
   * support custom log level, log files
   * support custom log rotation options (can be added in the future)
   * support transmit logs to external servers like syslog server (can be added 
in the future)
   * high performance as soon as possible
   
   I propose to use 
[zapcore](https://github.com/uber-go/zap/tree/master/zapcore) to implement it.



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] wfgydbu edited a comment on issue #2985: bug: 'limit-conn' plugin seems working in an unexpected manner

2020-12-07 Thread GitBox


wfgydbu edited a comment on issue #2985:
URL: https://github.com/apache/apisix/issues/2985#issuecomment-740423200


   @spacewander  I have ran some tests based on your modifications in #2465, 
looks fine on my machine.



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] wfgydbu commented on issue #2985: bug: 'limit-conn' plugin seems working in an unexpected manner

2020-12-07 Thread GitBox


wfgydbu commented on issue #2985:
URL: https://github.com/apache/apisix/issues/2985#issuecomment-740423200


   @spacewander  I ran some tests based on your modifications in #2465, looks 
fine on my machine.



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-ingress-controller] membphis commented on pull request #48: docs: add usage/design/install/contribute/FAQ docs & modify README

2020-12-07 Thread GitBox


membphis commented on pull request #48:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/48#issuecomment-740420284


   
![image](https://user-images.githubusercontent.com/6814606/101450232-2dee3c80-3965-11eb-837e-a09a250561fa.png)
   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-ingress-controller] membphis commented on pull request #48: docs: add usage/design/install/contribute/FAQ docs & modify README

2020-12-07 Thread GitBox


membphis commented on pull request #48:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/48#issuecomment-740419091


   
![image](https://user-images.githubusercontent.com/6814606/101450022-ca640f00-3964-11eb-97e7-b7fae64f3ff2.png)
   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] tokers commented on a change in pull request #2926: feat: server info

2020-12-07 Thread GitBox


tokers commented on a change in pull request #2926:
URL: https://github.com/apache/apisix/pull/2926#discussion_r538076602



##
File path: doc/plugins/server-info.md
##
@@ -0,0 +1,104 @@
+
+
+- [中文](../zh-cn/plugins/server-info.md)
+
+# Summary
+
+- [**Name**](#name)
+- [**Attributes**](#attributes)
+- [API](#api)
+- [**How To Enable**](#how-to-enable)
+- [**Test Plugin**](#test-plugin)
+- [**Disable Plugin**](#disable-plugin)
+
+## Name
+
+`server-info` is a plugin that reports basic server information to etcd 
periodically.
+
+The meaning of each item in server information is following:
+
+| Name| Type | Description |
+|-|--|-|
+| up_time | integer | Elapsed time since APISIX instance was launched, value 
will be reset when you hot updating APISIX but is kept for intact if you just 
reloading APISIX. |
+| boot_time | integer | Bootstrap timestamp of the APISIX instance, value will 
be reset when you hot updating APISIX but is kept for intact if you just 
reloading APISIX. |

Review comment:
   Now the logic about writing the uninitialized data was removed.
   
   since after APISIX launches, timer will be created immediately which updates 
the server info according to existing one in shdict, the boot_time will be 
inherited (or the uninitialized data if no data in shdict).





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] liuxiran commented on pull request #979: Refactor online debug be

2020-12-07 Thread GitBox


liuxiran commented on pull request #979:
URL: https://github.com/apache/apisix-dashboard/pull/979#issuecomment-740415708


   Request help:
   
   I added some e2e test cases for the new API `POST 
/apisix/admin/debug-request-forwarding`, which is used to forward the online 
debug request from FE. As we can see now the CI for BE e2e test are failed , 
but the same cases were passed when I called the API from FE. 
   
   ![2020-12-08 
14-36-00屏幕截图](https://user-images.githubusercontent.com/2561857/101448989-ef578280-3962-11eb-82ee-467bf9ed5b96.png)
   
   After attempted again and again, it is seems that  It has nothing to do with 
code logic. I still can not find the clue. Ask for help.
   
   
   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] spacewander commented on a change in pull request #2926: feat: server info

2020-12-07 Thread GitBox


spacewander commented on a change in pull request #2926:
URL: https://github.com/apache/apisix/pull/2926#discussion_r538073535



##
File path: doc/plugins/server-info.md
##
@@ -0,0 +1,104 @@
+
+
+- [中文](../zh-cn/plugins/server-info.md)
+
+# Summary
+
+- [**Name**](#name)
+- [**Attributes**](#attributes)
+- [API](#api)
+- [**How To Enable**](#how-to-enable)
+- [**Test Plugin**](#test-plugin)
+- [**Disable Plugin**](#disable-plugin)
+
+## Name
+
+`server-info` is a plugin that reports basic server information to etcd 
periodically.
+
+The meaning of each item in server information is following:
+
+| Name| Type | Description |
+|-|--|-|
+| up_time | integer | Elapsed time since APISIX instance was launched, value 
will be reset when you hot updating APISIX but is kept for intact if you just 
reloading APISIX. |
+| boot_time | integer | Bootstrap timestamp of the APISIX instance, value will 
be reset when you hot updating APISIX but is kept for intact if you just 
reloading APISIX. |

Review comment:
   > only when the key "server_info" doesn't exist
   
   So where is the check? Do I miss something?





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] tokers commented on a change in pull request #2926: feat: server info

2020-12-07 Thread GitBox


tokers commented on a change in pull request #2926:
URL: https://github.com/apache/apisix/pull/2926#discussion_r538073325



##
File path: apisix/plugins/server-info.lua
##
@@ -0,0 +1,238 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements.  See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License.  You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+local require = require
+local core = require("apisix.core")
+local timers = require("apisix.timers")
+
+local ngx_time = ngx.time
+local ngx_timer_at = ngx.timer.at
+local type = type
+local ceil = math.ceil
+
+local boot_time = os.time()
+local plugin_name = "server-info"
+local schema = {
+type = "object",
+additionalProperties = false,
+}
+local attr_schema = {
+type = "object",
+properties = {
+report_interval = {
+type = "integer",
+description = "server info reporting interval (unit: second)",
+default = 60,
+minimum = 60,
+maximum = 3600,
+},
+report_ttl = {
+type = "integer",
+description = "live time for server info in etcd",
+default = 7200,
+minimum = 3600,
+maximum = 86400,
+}
+}
+}
+
+local internal_status = ngx.shared.internal_status
+if not internal_status then
+error("lua_shared_dict \"internal_status\" not configured")
+end
+
+
+local _M = {
+version = 0.1,
+priority = 990,
+name = plugin_name,
+schema = schema,
+}
+
+
+local function uninitialized_server_info()
+return {
+etcd_version = "unknown",
+hostname = core.utils.gethostname(),
+id   = core.id.get(),
+version  = core.version.VERSION,
+up_time  = ngx_time() - boot_time,
+boot_time= boot_time,
+last_report_time = -1,
+}
+end
+
+
+-- server information will be saved into shared memory only if the key
+-- "server_info" not exist if excl is true.
+local function save(data, excl)
+local handler = excl and internal_status.add or internal_status.set
+
+local ok, err = handler(internal_status, "server_info", data)
+if not ok then
+if excl and err == "exists" then
+return true
+end
+
+return nil, err
+end
+
+return true
+end
+
+
+local function encode_and_save(server_info, excl)
+local data, err = core.json.encode(server_info)
+if not data then
+return nil, err
+end
+
+return save(data, excl)
+end
+
+
+local function get()
+local data, err = internal_status:get("server_info")
+if err ~= nil then
+return nil, err
+end
+
+if not data then
+return uninitialized_server_info()
+end
+
+local server_info, err = core.json.decode(data)
+if not server_info then
+return nil, err
+end
+
+server_info.up_time = ngx_time() - server_info.boot_time
+return server_info
+end
+
+
+local function report(premature, report_ttl)
+if premature then
+return
+end
+
+local server_info, err = get()
+if not server_info then
+core.log.error("failed to get server_info: ", err)
+return
+end
+
+if server_info.etcd_version == "unknown" then
+local res, err = core.etcd.server_version()
+if not res then
+core.log.error("failed to fetch etcd version: ", err)
+return
+
+elseif type(res.body) ~= "table" then
+core.log.error("failed to fetch etcd version: bad version info")
+return
+
+else
+server_info.etcd_version = res.body.etcdcluster
+end
+end
+
+server_info.last_report_time = ngx_time()
+
+local data, err = core.json.encode(server_info)
+if not data then
+core.log.error("failed to encode server_info: ", err)
+return
+end
+
+local key = "/data_plane/server_info/" .. server_info.id
+local ok, err = core.etcd.set(key, data, report_ttl)
+if not ok then
+core.log.error("failed to report server info to etcd: ", err)
+return
+end
+
+local ok, err = save(data, false)
+if not ok then
+core.log.error("failed to encode and save server info: ", err)
+return
+end
+end
+
+
+function 

[GitHub] [apisix] spacewander commented on a change in pull request #2926: feat: server info

2020-12-07 Thread GitBox


spacewander commented on a change in pull request #2926:
URL: https://github.com/apache/apisix/pull/2926#discussion_r538071956



##
File path: apisix/plugins/server-info.lua
##
@@ -0,0 +1,238 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements.  See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License.  You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+local require = require
+local core = require("apisix.core")
+local timers = require("apisix.timers")
+
+local ngx_time = ngx.time
+local ngx_timer_at = ngx.timer.at
+local type = type
+local ceil = math.ceil
+
+local boot_time = os.time()
+local plugin_name = "server-info"
+local schema = {
+type = "object",
+additionalProperties = false,
+}
+local attr_schema = {
+type = "object",
+properties = {
+report_interval = {
+type = "integer",
+description = "server info reporting interval (unit: second)",
+default = 60,
+minimum = 60,
+maximum = 3600,
+},
+report_ttl = {
+type = "integer",
+description = "live time for server info in etcd",
+default = 7200,
+minimum = 3600,
+maximum = 86400,
+}
+}
+}
+
+local internal_status = ngx.shared.internal_status
+if not internal_status then
+error("lua_shared_dict \"internal_status\" not configured")
+end
+
+
+local _M = {
+version = 0.1,
+priority = 990,
+name = plugin_name,
+schema = schema,
+}
+
+
+local function uninitialized_server_info()
+return {
+etcd_version = "unknown",
+hostname = core.utils.gethostname(),
+id   = core.id.get(),
+version  = core.version.VERSION,
+up_time  = ngx_time() - boot_time,
+boot_time= boot_time,
+last_report_time = -1,
+}
+end
+
+
+-- server information will be saved into shared memory only if the key
+-- "server_info" not exist if excl is true.
+local function save(data, excl)
+local handler = excl and internal_status.add or internal_status.set
+
+local ok, err = handler(internal_status, "server_info", data)
+if not ok then
+if excl and err == "exists" then
+return true
+end
+
+return nil, err
+end
+
+return true
+end
+
+
+local function encode_and_save(server_info, excl)
+local data, err = core.json.encode(server_info)
+if not data then
+return nil, err
+end
+
+return save(data, excl)
+end
+
+
+local function get()
+local data, err = internal_status:get("server_info")
+if err ~= nil then
+return nil, err
+end
+
+if not data then
+return uninitialized_server_info()
+end
+
+local server_info, err = core.json.decode(data)
+if not server_info then
+return nil, err
+end
+
+server_info.up_time = ngx_time() - server_info.boot_time
+return server_info
+end
+
+
+local function report(premature, report_ttl)
+if premature then
+return
+end
+
+local server_info, err = get()
+if not server_info then
+core.log.error("failed to get server_info: ", err)
+return
+end
+
+if server_info.etcd_version == "unknown" then
+local res, err = core.etcd.server_version()
+if not res then
+core.log.error("failed to fetch etcd version: ", err)
+return
+
+elseif type(res.body) ~= "table" then
+core.log.error("failed to fetch etcd version: bad version info")
+return
+
+else
+server_info.etcd_version = res.body.etcdcluster
+end
+end
+
+server_info.last_report_time = ngx_time()
+
+local data, err = core.json.encode(server_info)
+if not data then
+core.log.error("failed to encode server_info: ", err)
+return
+end
+
+local key = "/data_plane/server_info/" .. server_info.id
+local ok, err = core.etcd.set(key, data, report_ttl)
+if not ok then
+core.log.error("failed to report server info to etcd: ", err)
+return
+end
+
+local ok, err = save(data, false)
+if not ok then
+core.log.error("failed to encode and save server info: ", err)
+return
+end
+end
+
+
+function 

[GitHub] [apisix-ingress-controller] membphis commented on a change in pull request #48: docs: add usage/design/install/contribute/FAQ docs & modify README

2020-12-07 Thread GitBox


membphis commented on a change in pull request #48:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/48#discussion_r537982915



##
File path: samples/deploy/rbac/apisix_view_clusterrolebinding.yaml
##
@@ -8,5 +8,4 @@ roleRef:
   name: apisix-view-clusterrole
 subjects:
 - kind: ServiceAccount
-  name: apisix-view-serviceaccount
-  namespace: cloud
\ No newline at end of file
+  name: apisix-view-serviceaccount

Review comment:
   need a blank line at the end of file

##
File path: samples/deploy/rbac/service_account.yaml
##
@@ -2,4 +2,4 @@ apiVersion: v1
 kind: ServiceAccount
 metadata:
   name: apisix-view-serviceaccount
-  namespace: cloud
\ No newline at end of file
+  

Review comment:
   ditto





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] membphis commented on issue #984: reject request data if it contains an empty array, eg: "remote_addrs": []

2020-12-07 Thread GitBox


membphis commented on issue #984:
URL: 
https://github.com/apache/apisix-dashboard/issues/984#issuecomment-740410851


   @liuxiran @juzhiyuan @moonming pls take a look when you have time ^_^



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] membphis opened a new issue #984: reject request data if it contains an empty array, eg: "remote_addrs": []

2020-12-07 Thread GitBox


membphis opened a new issue #984:
URL: https://github.com/apache/apisix-dashboard/issues/984


   To add a route, if the `remote_addrs` field is an empty array, the matching 
behavior is ambiguous.
   
   In order to avoid ambiguity and keep the API design simple and clear, we 
should reject the value as an empty array.
   
   Here is an example, should return `400`:
   
   ```
   $ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
   {
   "uri": "/index.html",
   "remote_addrs": [],
   "enable_websocket": true,
   "upstream": {
   "type": "roundrobin",
   "nodes": {
   "39.97.63.215:80": 1
   }
   }
   }'
   HTTP/1.1 400 Bad Request
   ... ...
   ```
   
   **Here is the todo list(from the discussion)**
   
   * `Admin API`: reject request data if it contains an empty array, eg: 
`"remote_addrs": []`. `Code + Doc`
   * `Manager API`: same as `Admin API`.
   * `Dashbaord`: keep adding hacking codes to the frontend. `Code`
   
   The field `hosts`, `uris` and `methods`, they have the same issue, we should 
fix them in the same way too.
   
   original comment: 
https://github.com/apache/apisix/issues/2924#issuecomment-740405671
   
   related issue: https://github.com/apache/apisix/issues/2991



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] juzhiyuan opened a new issue #983: reject request data if it contains an empty array, eg: "remote_addrs": []

2020-12-07 Thread GitBox


juzhiyuan opened a new issue #983:
URL: https://github.com/apache/apisix-dashboard/issues/983


   original comment 
https://github.com/apache/apisix/issues/2924#issuecomment-740405671
   
   # Feature request
   
   ## Please describe your feature
   
   reject request data if it contains an empty array, eg: "remote_addrs": []
   
   ## Describe the solution you'd like
   
   **Here is the todo list(from the discussion)**
   
   * `Admin API`: reject request data if it contains an empty array, eg: 
`"remote_addrs": []`. `Code + Doc`
   * `Manager API`: same as `Admin API`.
   * `Dashbaord`: keep adding hacking codes to the frontend. `Code`
   
   The field `hosts`, `uris` and `methods`, they have the same issue, we should 
fix them in the same way too.



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] membphis opened a new issue #2991: reject request data if it contains an empty array, eg: "remote_addrs": []

2020-12-07 Thread GitBox


membphis opened a new issue #2991:
URL: https://github.com/apache/apisix/issues/2991


   **Here is the todo list(from the discussion)**
   
   * `Admin API`: reject request data if it contains an empty array, eg: 
`"remote_addrs": []`. `Code + Doc`
   * `Manager API`: same as `Admin API`.
   * `Dashbaord`: keep adding hacking codes to the frontend. `Code`
   
   The field `hosts`, `uris` and `methods`, they have the same issue, we should 
fix them in the same way too.
   
   original comment: 
https://github.com/apache/apisix/issues/2924#issuecomment-740405671



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] membphis closed issue #2924: [Proposal] Support both empty array and field-omitted for fields like remote_addrs

2020-12-07 Thread GitBox


membphis closed issue #2924:
URL: https://github.com/apache/apisix/issues/2924


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on issue #2924: [Proposal] Support both empty array and field-omitted for fields like remote_addrs

2020-12-07 Thread GitBox


membphis commented on issue #2924:
URL: https://github.com/apache/apisix/issues/2924#issuecomment-740405671


   @juzhiyuan @liuxiran @nic-chen @moonming 
   
   I will close this issue and will create a new issue. I think we have 
finished the discussion, and here is the final result.
   
   Please feel free to reopen this issue if you have any problems with this 
issue.
   
   **Here is the todo list(from the discussion)**
   
   * `Admin API`: reject request data if it contains an empty array, eg: 
`"remote_addrs": []`. `Code + Doc`
   * `Manager API`: same as `Admin API`.
   * `Dashbaord`: keep adding hacking codes to the frontend. `Code`
   
   The field `hosts`, `uris` and `methods`, they have the same issue, we should 
fix them in the same way too.
   
   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[apisix-ingress-controller] branch chore/cli updated (7fd967f -> 7bf66e0)

2020-12-07 Thread tokers
This is an automated email from the ASF dual-hosted git repository.

tokers pushed a change to branch chore/cli
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git.


from 7fd967f  chore: added the command line
 add 7bf66e0  fix: removed the redundant os.Exit()

No new revisions were added by this update.

Summary of changes:
 cmd/ingress/ingress.go | 2 --
 1 file changed, 2 deletions(-)



[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #977: chore: enrich error log

2020-12-07 Thread GitBox


codecov-io edited a comment on pull request #977:
URL: https://github.com/apache/apisix-dashboard/pull/977#issuecomment-739972588


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/977?src=pr=h1) 
Report
   > Merging 
[#977](https://codecov.io/gh/apache/apisix-dashboard/pull/977?src=pr=desc) 
(4ba1f3a) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/8976cca55972b7ba8686843bd51241cbc3e1554c?el=desc)
 (8976cca) will **increase** coverage by `0.04%`.
   > The diff coverage is `24.13%`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/977/graphs/tree.svg?width=650=150=pr=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/977?src=pr=tree)
   
   ```diff
   @@Coverage Diff @@
   ##   master #977  +/-   ##
   ==
   + Coverage   43.41%   43.46%   +0.04% 
   ==
 Files  18   18  
 Lines1299 1300   +1 
   ==
   + Hits  564  565   +1 
 Misses643  643  
 Partials   92   92  
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-dashboard/pull/977?src=pr=tree) | 
Coverage Δ | |
   |---|---|---|
   | 
[api/internal/core/entity/format.go](https://codecov.io/gh/apache/apisix-dashboard/pull/977/diff?src=pr=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2Zvcm1hdC5nbw==)
 | `60.46% <0.00%> (ø)` | |
   | 
[api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/977/diff?src=pr=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=)
 | `0.00% <0.00%> (ø)` | |
   | 
[api/internal/core/store/validate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/977/diff?src=pr=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvdmFsaWRhdGUuZ28=)
 | `57.63% <0.00%> (-0.41%)` | :arrow_down: |
   | 
[api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/977/diff?src=pr=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=)
 | `79.22% <63.63%> (+0.64%)` | :arrow_up: |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/977?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/977?src=pr=footer).
 Last update 
[8976cca...4ba1f3a](https://codecov.io/gh/apache/apisix-dashboard/pull/977?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-ingress-controller] gxthrj commented on a change in pull request #48: docs: add usage/design/install/contribute/FAQ docs & modify README

2020-12-07 Thread GitBox


gxthrj commented on a change in pull request #48:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/48#discussion_r538061913



##
File path: docs/install.md
##
@@ -0,0 +1,129 @@
+# Installation
+
+## Dependencies
+
+* Kubernetes
+* [Deploy Apache APISIX in 
k8s](https://github.com/apache/apisix/blob/master/kubernetes/README.md)
+
+To install `ingress controller` in k8s, need to care about 3 parts:
+
+1. CRDs: They are the data structure of Apache APISIX in Kubernetes, used to 
define route, service, upstream, plugins, etc.
+
+2. RBAC: This is a function of Kubernetes, granting `ingress controller` 
resource access permissions.

Review comment:
   Done





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-ingress-controller] tokers commented on pull request #61: chore: added the command line

2020-12-07 Thread GitBox


tokers commented on pull request #61:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/61#issuecomment-740403392


   @gxthrj @membphis Need your help to review this PR.



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[apisix-ingress-controller] branch kv/docs updated (d53868b -> a2f7a66)

2020-12-07 Thread kvn
This is an automated email from the ASF dual-hosted git repository.

kvn pushed a change to branch kv/docs
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git.


from d53868b  doc: remove compare with other ingress controller
 add a2f7a66  doc: modify desc

No new revisions were added by this update.

Summary of changes:
 README.md   | 12 ++--
 docs/FAQ.md |  2 +-
 docs/design.md  |  4 ++--
 docs/develop.md |  2 +-
 docs/install.md |  4 ++--
 5 files changed, 12 insertions(+), 12 deletions(-)



[GitHub] [apisix-ingress-controller] tokers opened a new pull request #61: chore: added the command line

2020-12-07 Thread GitBox


tokers opened a new pull request #61:
URL: https://github.com/apache/apisix-ingress-controller/pull/61


   Closing #56 .
   
   This PR introduces [cobra](https://github.com/spf13/cobra) as the command 
line framework. Currently we have only one custom sub command "ingress", which 
is the entrypoint of apisix-ingress-controller, now users can launch 
apisix-ingress-controller by:
   
   ```
   $ apisix-ingress-controller ingress --config-path /path/to/conf.json
   ```
   
   Of course users can check the help message from:
   
   ```
   $ apisix-ingress-controller --help
   ```
   
   Which is friendly for users.
   
   By the way, the package "conf" was renamed to `pkg/config` and some basic 
refactoring was done, the `pkg/config` will be refactored consistently.



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[apisix-ingress-controller] 01/01: chore: added the command line

2020-12-07 Thread tokers
This is an automated email from the ASF dual-hosted git repository.

tokers pushed a commit to branch chore/cli
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git

commit 7fd967fdd3cdb2b45c488a207f1fef13ac31bcf3
Author: tokers 
AuthorDate: Tue Dec 8 14:05:42 2020 +0800

chore: added the command line
---
 .gitignore |   1 +
 Makefile   |  24 +++
 cmd/cmd.go |  19 +++
 cmd/ingress/ingress.go | 114 +
 conf/conf.json |  14 +-
 conf/{config => kubeconfig}|   0
 go.mod |  15 +-
 go.sum | 322 +++--
 log/log.go |  10 +-
 main.go|  57 +--
 {conf => pkg/config}/errno.go  |   2 +-
 {conf => pkg/config}/init.go   | 182 +++--
 pkg/ingress/controller/endpoint.go |  20 +--
 pkg/ingress/controller/watch.go|  14 +-
 pkg/ingress/endpoint/ep.go |   6 +-
 pkg/scheduler.go   |   8 +-
 pkg/utils/utils.go |  23 +++
 17 files changed, 558 insertions(+), 273 deletions(-)

diff --git a/.gitignore b/.gitignore
index 97cca67..8db5691 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,3 +12,4 @@
 *.out
 
 .idea
+apisix-ingress-controller
diff --git a/Makefile b/Makefile
new file mode 100644
index 000..d4f088b
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,24 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+default: build
+
+build:
+   go build -o apisix-ingress-controller main.go
+lint:
+   golangci-lint run
+
+.PHONY: build lint
\ No newline at end of file
diff --git a/cmd/cmd.go b/cmd/cmd.go
new file mode 100644
index 000..1179533
--- /dev/null
+++ b/cmd/cmd.go
@@ -0,0 +1,19 @@
+package cmd
+
+import (
+   "github.com/spf13/cobra"
+
+   "github.com/api7/ingress-controller/cmd/ingress"
+)
+
+// NewAPISIXIngressControllerCommand creates the apisix-ingress-controller 
command.
+func NewAPISIXIngressControllerCommand() *cobra.Command {
+   cmd := {
+   Use: "apisix-ingress-controller [command]",
+   Short:   "Yet another Ingress controller for Kubernetes using 
Apache APISIX as the high performance reverse proxy.",
+   Version: "", // TODO: fill the version info.
+   }
+
+   cmd.AddCommand(ingress.NewIngressCommand())
+   return cmd
+}
diff --git a/cmd/ingress/ingress.go b/cmd/ingress/ingress.go
new file mode 100644
index 000..df2e590
--- /dev/null
+++ b/cmd/ingress/ingress.go
@@ -0,0 +1,114 @@
+package ingress
+
+import (
+   "context"
+   "net/http"
+   "os"
+   "os/signal"
+   "syscall"
+   "time"
+
+   "github.com/golang/glog"
+   "github.com/spf13/cobra"
+   api6Informers 
"github.com/gxthrj/apisix-ingress-types/pkg/client/informers/externalversions"
+
+   "github.com/api7/ingress-controller/pkg"
+   "github.com/api7/ingress-controller/pkg/config"
+   "github.com/api7/ingress-controller/log"
+   "github.com/api7/ingress-controller/pkg/ingress/controller"
+   "github.com/api7/ingress-controller/pkg/utils"
+)
+
+// NewIngressCommand creates the ingress sub command for 
apisix-ingress-controller.
+func NewIngressCommand() *cobra.Command {
+   var (
+   configPath string
+   )
+   conf := config.NewDefaultConfig()
+   cmd := {
+   Use: "ingress [flags]",
+   Short:   "launch the controller",
+   Example: `Run apisix-ingress-controller from configuration file:
+
+   apisix-ingress-controller ingress --config-path /path/to/config.json`,
+   Run: func(cmd *cobra.Command, args []string) {
+   logger := log.GetLogger()
+   if configPath != "" {
+   fileConf, err := 
config.NewConfigFromFile(configPath)
+   if err != nil {
+   utils.Dief("failed to parse 
configuration file [%s]: %s", configPath, err.Error())
+   os.Exit(1)
+   }
+ 

[apisix-ingress-controller] branch chore/cli created (now 7fd967f)

2020-12-07 Thread tokers
This is an automated email from the ASF dual-hosted git repository.

tokers pushed a change to branch chore/cli
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git.


  at 7fd967f  chore: added the command line

This branch includes the following new commits:

 new 7fd967f  chore: added the command line

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[GitHub] [apisix-dashboard] codecov-io commented on pull request #982: draft: add frontend e2e test for create route

2020-12-07 Thread GitBox


codecov-io commented on pull request #982:
URL: https://github.com/apache/apisix-dashboard/pull/982#issuecomment-740400550


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/982?src=pr=h1) 
Report
   > Merging 
[#982](https://codecov.io/gh/apache/apisix-dashboard/pull/982?src=pr=desc) 
(87ae02a) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/8976cca55972b7ba8686843bd51241cbc3e1554c?el=desc)
 (8976cca) will **increase** coverage by `0.07%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/982/graphs/tree.svg?width=650=150=pr=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/982?src=pr=tree)
   
   ```diff
   @@Coverage Diff @@
   ##   master #982  +/-   ##
   ==
   + Coverage   43.41%   43.49%   +0.07% 
   ==
 Files  18   18  
 Lines1299 1299  
   ==
   + Hits  564  565   +1 
   + Misses643  642   -1 
 Partials   92   92  
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-dashboard/pull/982?src=pr=tree) | 
Coverage Δ | |
   |---|---|---|
   | 
[api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/982/diff?src=pr=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=)
 | `79.22% <0.00%> (+0.64%)` | :arrow_up: |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/982?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/982?src=pr=footer).
 Last update 
[8976cca...87ae02a](https://codecov.io/gh/apache/apisix-dashboard/pull/982?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] codecov-io commented on pull request #972: test: e2e test balancer (roundrobin upstream)

2020-12-07 Thread GitBox


codecov-io commented on pull request #972:
URL: https://github.com/apache/apisix-dashboard/pull/972#issuecomment-740398706


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/972?src=pr=h1) 
Report
   > Merging 
[#972](https://codecov.io/gh/apache/apisix-dashboard/pull/972?src=pr=desc) 
(4c9c08f) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/8976cca55972b7ba8686843bd51241cbc3e1554c?el=desc)
 (8976cca) will **increase** coverage by `0.07%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/972/graphs/tree.svg?width=650=150=pr=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/972?src=pr=tree)
   
   ```diff
   @@Coverage Diff @@
   ##   master #972  +/-   ##
   ==
   + Coverage   43.41%   43.49%   +0.07% 
   ==
 Files  18   18  
 Lines1299 1299  
   ==
   + Hits  564  565   +1 
   + Misses643  642   -1 
 Partials   92   92  
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-dashboard/pull/972?src=pr=tree) | 
Coverage Δ | |
   |---|---|---|
   | 
[api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/972/diff?src=pr=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=)
 | `79.22% <0.00%> (+0.64%)` | :arrow_up: |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/972?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/972?src=pr=footer).
 Last update 
[8976cca...4c9c08f](https://codecov.io/gh/apache/apisix-dashboard/pull/972?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] ziyou434 commented on issue #2989: bug: Route url

2020-12-07 Thread GitBox


ziyou434 commented on issue #2989:
URL: https://github.com/apache/apisix/issues/2989#issuecomment-740398515


   > What are your steps? In my environment, APISIX does not have this problem, 
but the dashboard will prompt that this setting is not allowed.
   
   ```
   curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
   "uri": "/v1/receipt/verify",
   "upstream": {
   "type": "roundrobin",
   "nodes": {
   "192.168.199.1:8080": 1
   }
   }
   }'
   
   curl http://127.0.0.1:9080/v1/receipt/verify
   
   It will get a mistake.
   ```



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-ingress-controller] gxthrj commented on a change in pull request #48: docs: add usage/design/install/contribute/FAQ docs & modify README

2020-12-07 Thread GitBox


gxthrj commented on a change in pull request #48:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/48#discussion_r538056827



##
File path: docs/install.md
##
@@ -0,0 +1,129 @@
+# Installation
+
+## Dependencies
+
+* Kubernetes
+* [Deploy Apache APISIX in 
k8s](https://github.com/apache/apisix/blob/master/kubernetes/README.md)
+
+To install `ingress controller` in k8s, need to care about 3 parts:
+
+1. CRDs: They are the data structure of Apache APISIX in Kubernetes, used to 
define route, service, upstream, plugins, etc.

Review comment:
   Done





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] idbeta commented on issue #2989: bug: Route url

2020-12-07 Thread GitBox


idbeta commented on issue #2989:
URL: https://github.com/apache/apisix/issues/2989#issuecomment-740397552


   What are your steps? In my environment, APISIX does not have this problem, 
but the dashboard will prompt that this setting is not allowed. 



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-ingress-controller] gxthrj commented on a change in pull request #48: docs: add usage/design/install/contribute/FAQ docs & modify README

2020-12-07 Thread GitBox


gxthrj commented on a change in pull request #48:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/48#discussion_r538056451



##
File path: docs/develop.md
##
@@ -162,22 +168,22 @@ spec:
 host: internalalpha.talkinggenie.com
 enable_websocket: true
 ```
-config中定义需要按照 插件```proxy-rewrite```的schema定义;
 
-如果插件的schema是一个数组,需要用将config字段修改为config_set;
+The definition in config needs to follow the schema definition of the plugin 
`proxy-rewrite`.

Review comment:
   Done





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-ingress-controller] gxthrj commented on a change in pull request #48: docs: add usage/design/install/contribute/FAQ docs & modify README

2020-12-07 Thread GitBox


gxthrj commented on a change in pull request #48:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/48#discussion_r538056103



##
File path: docs/design.md
##
@@ -36,6 +36,88 @@ Apache APISIX ingress for Kubernetes.
 
 - match and covert Apisix-ingress-types to Apisix-types before handing the 
control over to the above module seven;
 
-## Sequence Diagram
+## CRD design
 
-![Sequence Diagram](../images/flow.png)
+Currently `apisix-ingress-controller` CRDs consist of 3 parts: 
ApisixRoute/ApisixService/ApisixUpstream. The design follows the following 
ideas.
+
+1. The most important part of the gateway is the route part, which is used to 
define the distribution rules of the gateway traffics.
+2. In order to facilitate understanding and configuration, the design 
structure of `ApisixRoute` is basically similar to Kubernetes Ingress.
+3. In the design of annotation, the structure of Kubernetes Ingress is used 
for reference, but the internal implementation is based on the plug-in of 
Apache APISIX.
+4. Both `ApisixRoute` and `ApisixService` can be bound to plug-ins, which is 
consistent with Apache APISIX.
+5. In the simplest case, you only need to define `ApisixRoute`, and the 
Ingress controller will automatically add `ApisixService` and `ApisixUpstream`.
+6. `ApisixService`, like Apache APISIX service, is a grouping of routes, which 
can simplify the configuration complexity of the same plug-in.
+7. `ApisixUpstream` can define some details on Apache APISIX upstream, such as 
load balancing/health check, etc.
+
+## Monitoring CRDs
+
+`apisix-ingress-controller` is responsible for interacting with the Kubernetes 
Apiserver, applying for accessible resource permissions (RBAC), monitoring 
changes, and implementing object conversion within the Ingress controller, 
comparing the changes, and then synchronizing to Apache APISIX.
+
+### Timing diagram
+
+![flow](./images/flow.png)
+
+### Conversion structure
+
+`apisix-ingress-controller` provides external configuration methods for CRDs. 
It is aimed at operators such as daily operation and maintenance, who often 
need to process a large number of routes in batches, hoping to handle all 
related services in the same configuration file, and at the same time have 
convenient and understandable management capabilities. Apache APISIX is 
designed from the perspective of the gateway, and all routes are independent. 
This leads to obvious differences in the data structure between the two. One 
focuses on batch definition, while the other is discrete implementation.
+
+Taking into account the usage habits of different groups of people, the data 
structure of CRDs draws on the data structure of Kubernetes Ingress, and is 
basically the same in shape.
+
+A simple comparison is as follows, they have different definitions:
+
+![strut-compare](./images/struct-compare.png)
+
+They are a many-to-many relationship.Therefore, `apisix-ingress-controller` 
has to do some conversion of CRDs to adapt to different gateways.
+
+### Cascade update
+
+At present, we have defined multiple CRDs, and these CRDs are responsible for 
the definition of their respective fields. `ApisixRoute`/ `ApisixService` / 
`ApisixUpstream` correspond to objects such as `route`/ `service` / `upstream` 
in Apache APISIX. As the strong binding relationship between APISIX objects, 
when modifying and deleting batch data structures such as CRDs, you have to 
consider the impact of cascading between objects.
+
+So, in `apisix-ingress-controller`, a broadcast notification mechanism is 
designed through `channel`, that is, the definition of any object must be 
notified to other objects related to it and trigger the corresponding behavior.
+
+![hierarchical](./images/hierarchical.png)
+
+In a typical scenario, there is a many-to-many relationship between 
`ApisixRoute` and `ApisixService`, and a one-to-one relationship between 
`ApisixService` and `ApisixUpstream`.
+
+* When the `ApisixService` changes, it needs to be notified upwards to the 
`ApisixRoute`, and also needs to be notified downwards to the corresponding 
`ApisixUpstream`.
+* When one of the `http-route` in `ApisixRoute` changes, the relevant 
`ApisixService` and `ApisixUpstream` need to be notified.
+
+This is particularly prominent in `modify` and `delete`.
+
+**We can initiate discussions in this area and propose a more reasonable 
design plan**
+
+### Diff rules
+
+The `seven` module internally saves memory data structures, which is currently 
very similar to the Apache Apisix resource object. When the Kubernetes resource 
object is newly changed, `seven` will compare the memory objects and update 
incrementally according to the result of the comparison.
+
+The current comparison rule is based on the grouping of `route` / `service` / 
`upstream` resource objects, compare them separately, and make corresponding 
broadcast notifications after finding the differences.
+
+![diff-flow](./images/diff-flow.png)
+
+### 

[GitHub] [apisix-ingress-controller] gxthrj commented on a change in pull request #48: docs: add usage/design/install/contribute/FAQ docs & modify README

2020-12-07 Thread GitBox


gxthrj commented on a change in pull request #48:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/48#discussion_r538055578



##
File path: docs/design.md
##
@@ -36,6 +36,88 @@ Apache APISIX ingress for Kubernetes.
 
 - match and covert Apisix-ingress-types to Apisix-types before handing the 
control over to the above module seven;
 
-## Sequence Diagram
+## CRD design
 
-![Sequence Diagram](../images/flow.png)
+Currently `apisix-ingress-controller` CRDs consist of 3 parts: 
ApisixRoute/ApisixService/ApisixUpstream. The design follows the following 
ideas.
+
+1. The most important part of the gateway is the route part, which is used to 
define the distribution rules of the gateway traffics.
+2. In order to facilitate understanding and configuration, the design 
structure of `ApisixRoute` is basically similar to Kubernetes Ingress.
+3. In the design of annotation, the structure of Kubernetes Ingress is used 
for reference, but the internal implementation is based on the plug-in of 
Apache APISIX.
+4. Both `ApisixRoute` and `ApisixService` can be bound to plug-ins, which is 
consistent with Apache APISIX.
+5. In the simplest case, you only need to define `ApisixRoute`, and the 
Ingress controller will automatically add `ApisixService` and `ApisixUpstream`.
+6. `ApisixService`, like Apache APISIX service, is a grouping of routes, which 
can simplify the configuration complexity of the same plug-in.
+7. `ApisixUpstream` can define some details on Apache APISIX upstream, such as 
load balancing/health check, etc.
+
+## Monitoring CRDs
+
+`apisix-ingress-controller` is responsible for interacting with the Kubernetes 
Apiserver, applying for accessible resource permissions (RBAC), monitoring 
changes, and implementing object conversion within the Ingress controller, 
comparing the changes, and then synchronizing to Apache APISIX.
+
+### Timing diagram
+
+![flow](./images/flow.png)
+
+### Conversion structure
+
+`apisix-ingress-controller` provides external configuration methods for CRDs. 
It is aimed at operators such as daily operation and maintenance, who often 
need to process a large number of routes in batches, hoping to handle all 
related services in the same configuration file, and at the same time have 
convenient and understandable management capabilities. Apache APISIX is 
designed from the perspective of the gateway, and all routes are independent. 
This leads to obvious differences in the data structure between the two. One 
focuses on batch definition, while the other is discrete implementation.
+
+Taking into account the usage habits of different groups of people, the data 
structure of CRDs draws on the data structure of Kubernetes Ingress, and is 
basically the same in shape.
+
+A simple comparison is as follows, they have different definitions:
+
+![strut-compare](./images/struct-compare.png)
+
+They are a many-to-many relationship.Therefore, `apisix-ingress-controller` 
has to do some conversion of CRDs to adapt to different gateways.
+
+### Cascade update
+
+At present, we have defined multiple CRDs, and these CRDs are responsible for 
the definition of their respective fields. `ApisixRoute`/ `ApisixService` / 
`ApisixUpstream` correspond to objects such as `route`/ `service` / `upstream` 
in Apache APISIX. As the strong binding relationship between APISIX objects, 
when modifying and deleting batch data structures such as CRDs, you have to 
consider the impact of cascading between objects.
+
+So, in `apisix-ingress-controller`, a broadcast notification mechanism is 
designed through `channel`, that is, the definition of any object must be 
notified to other objects related to it and trigger the corresponding behavior.
+
+![hierarchical](./images/hierarchical.png)
+
+In a typical scenario, there is a many-to-many relationship between 
`ApisixRoute` and `ApisixService`, and a one-to-one relationship between 
`ApisixService` and `ApisixUpstream`.
+
+* When the `ApisixService` changes, it needs to be notified upwards to the 
`ApisixRoute`, and also needs to be notified downwards to the corresponding 
`ApisixUpstream`.
+* When one of the `http-route` in `ApisixRoute` changes, the relevant 
`ApisixService` and `ApisixUpstream` need to be notified.
+
+This is particularly prominent in `modify` and `delete`.
+
+**We can initiate discussions in this area and propose a more reasonable 
design plan**
+
+### Diff rules
+
+The `seven` module internally saves memory data structures, which is currently 
very similar to the Apache Apisix resource object. When the Kubernetes resource 
object is newly changed, `seven` will compare the memory objects and update 
incrementally according to the result of the comparison.
+
+The current comparison rule is based on the grouping of `route` / `service` / 
`upstream` resource objects, compare them separately, and make corresponding 
broadcast notifications after finding the differences.
+
+![diff-flow](./images/diff-flow.png)
+
+### 

[GitHub] [apisix-ingress-controller] gxthrj commented on a change in pull request #48: docs: add usage/design/install/contribute/FAQ docs & modify README

2020-12-07 Thread GitBox


gxthrj commented on a change in pull request #48:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/48#discussion_r538055367



##
File path: docs/FAQ.md
##
@@ -0,0 +1,15 @@
+# FAQ
+
+1. How to bind between Service and Upstream?

Review comment:
   Done





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-ingress-controller] gxthrj commented on a change in pull request #48: docs: add usage/design/install/contribute/FAQ docs & modify README

2020-12-07 Thread GitBox


gxthrj commented on a change in pull request #48:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/48#discussion_r538055175



##
File path: README.md
##
@@ -13,147 +22,84 @@ Configure 
[plugins](https://github.com/apache/apisix/tree/master/doc/plugins), l
 * Support load balancing based on pod (upstream nodes).
 * Plug-in extension supports hot configuration and immediate effect.
 * Ingress controller itself as a plugable hot-reload component.
+* Multi-cluster configuration distribution.
+
+## Architecture
+
+![Architecture](./docs/images/module-1.png)
+
+### 1.Ingress types

Review comment:
   `ingress-types` is the name of 
[submodule](https://github.com/api7/ingress-types) in the 
./docs/images/module-1.png. 
   And explained below the title are defined resources.
   
   How about adds `submodule` after the titles.





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-ingress-controller] gxthrj commented on a change in pull request #48: docs: add usage/design/install/contribute/FAQ docs & modify README

2020-12-07 Thread GitBox


gxthrj commented on a change in pull request #48:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/48#discussion_r538052942



##
File path: README.md
##
@@ -13,147 +22,84 @@ Configure 
[plugins](https://github.com/apache/apisix/tree/master/doc/plugins), l
 * Support load balancing based on pod (upstream nodes).
 * Plug-in extension supports hot configuration and immediate effect.
 * Ingress controller itself as a plugable hot-reload component.
+* Multi-cluster configuration distribution.
+
+## Architecture
+
+![Architecture](./docs/images/module-1.png)
+
+### 1.Ingress types
+
+- defines the CRD(CustomResourceDefinition) needed by Apache APISIX
+
+- currently supports ApisixRoute/ApisixService/ApisixUpstream,and other 
service and route level plugins.
+
+- can be packaged as a stand-alone binary, keep in sync with the ingress 
definition.
+
+- [CRD design](https://github.com/api7/ingress-controller/issues/3)
+
+### 2. APISIX types
+
+- define interface objects to match concepts from Apache APISIX like route, 
service, upstream, and plugin.
+
+- can be a packaged as a stand-alone binary, need to match with compatible 
Apache APISIX version.
+
+- add new types to this module to support new features.
+
+### 3.Seven

Review comment:
   How about changing to `The `Seven` submodule`





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-ingress-controller] gxthrj commented on a change in pull request #48: docs: add usage/design/install/contribute/FAQ docs & modify README

2020-12-07 Thread GitBox


gxthrj commented on a change in pull request #48:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/48#discussion_r538048793



##
File path: README.md
##
@@ -2,7 +2,16 @@
 
 Use Apache APISIX for Kubernetes 
[Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/)
 
-Configure [plugins](https://github.com/apache/apisix/tree/master/doc/plugins), 
load balancing and more in Apache APISIX for Kubernetes Services, support 
service registration discovery mechanism for upstreams. All using Custom 
Resource Definitions (CRDs).
+In `apisix-ingress-controller`, all using Custom Resource Definitions (CRDs). 
Such as configure 
[plugins](https://github.com/apache/apisix/tree/master/doc/plugins), upport 
service registration discovery mechanism for upstreams, load balancing and more 
in Apache APISIX.
+
+Compared with other ingress controllers, `apisix-ingress-controller` have 
solved several obvious problems.
+
+* Dynamically update the configuration, no need to reload.

Review comment:
   Done, Remove the section of compare with other ingress controller.





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-ingress-controller] gxthrj commented on a change in pull request #48: docs: add usage/design/install/contribute/FAQ docs & modify README

2020-12-07 Thread GitBox


gxthrj commented on a change in pull request #48:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/48#discussion_r538051398



##
File path: README.md
##
@@ -2,7 +2,16 @@
 
 Use Apache APISIX for Kubernetes 
[Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/)
 
-Configure [plugins](https://github.com/apache/apisix/tree/master/doc/plugins), 
load balancing and more in Apache APISIX for Kubernetes Services, support 
service registration discovery mechanism for upstreams. All using Custom 
Resource Definitions (CRDs).
+In `apisix-ingress-controller`, all using Custom Resource Definitions (CRDs). 
Such as configure 
[plugins](https://github.com/apache/apisix/tree/master/doc/plugins), upport 
service registration discovery mechanism for upstreams, load balancing and more 
in Apache APISIX.
+
+Compared with other ingress controllers, `apisix-ingress-controller` have 
solved several obvious problems.
+
+* Dynamically update the configuration, no need to reload.
+* Flexible extension capabilities based on plugins.

Review comment:
   Done, Remove the section of compare with other ingress controller





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] wfgydbu edited a comment on issue #2985: bug: 'limit-conn' plugin seems working in an unexpected manner

2020-12-07 Thread GitBox


wfgydbu edited a comment on issue #2985:
URL: https://github.com/apache/apisix/issues/2985#issuecomment-740344661


   
https://github.com/apache/apisix/blob/v2.1/apisix/plugins/limit-conn.lua#L88-L94
   
   I think these code should be something like this:
   ```
   if lim:is_committed() then
   if not ctx.limit_conn then
   ctx.limit_conn = core.tablepool.fetch("plugin#limit-conn", 0, 6)
   end
   
   core.table.insert_tail(ctx.limit_conn, lim, key, delay)
   end
   ```



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-ingress-controller] gxthrj commented on a change in pull request #48: docs: add usage/design/install/contribute/FAQ docs & modify README

2020-12-07 Thread GitBox


gxthrj commented on a change in pull request #48:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/48#discussion_r538050918



##
File path: README.md
##
@@ -2,7 +2,16 @@
 
 Use Apache APISIX for Kubernetes 
[Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/)
 
-Configure [plugins](https://github.com/apache/apisix/tree/master/doc/plugins), 
load balancing and more in Apache APISIX for Kubernetes Services, support 
service registration discovery mechanism for upstreams. All using Custom 
Resource Definitions (CRDs).
+In `apisix-ingress-controller`, all using Custom Resource Definitions (CRDs). 
Such as configure 
[plugins](https://github.com/apache/apisix/tree/master/doc/plugins), upport 
service registration discovery mechanism for upstreams, load balancing and more 
in Apache APISIX.
+
+Compared with other ingress controllers, `apisix-ingress-controller` have 
solved several obvious problems.
+
+* Dynamically update the configuration, no need to reload.
+* Flexible extension capabilities based on plugins.
+* Convenient traffic split.
+* Multi-cluster configuration distribution.
+
+`apisix-ingress-controller` belongs to Apache APISIX control plane. Currently 
it serves for Kubernetes clusters. In the future, we plan to separate the 
submodule to adapt to more deployment modes, such as virtual machine clusters.

Review comment:
   Done





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-ingress-controller] gxthrj commented on a change in pull request #48: docs: add usage/design/install/contribute/FAQ docs & modify README

2020-12-07 Thread GitBox


gxthrj commented on a change in pull request #48:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/48#discussion_r538050460



##
File path: README.md
##
@@ -2,7 +2,16 @@
 
 Use Apache APISIX for Kubernetes 
[Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/)
 
-Configure [plugins](https://github.com/apache/apisix/tree/master/doc/plugins), 
load balancing and more in Apache APISIX for Kubernetes Services, support 
service registration discovery mechanism for upstreams. All using Custom 
Resource Definitions (CRDs).
+In `apisix-ingress-controller`, all using Custom Resource Definitions (CRDs). 
Such as configure 
[plugins](https://github.com/apache/apisix/tree/master/doc/plugins), upport 
service registration discovery mechanism for upstreams, load balancing and more 
in Apache APISIX.

Review comment:
   Done





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-ingress-controller] gxthrj commented on a change in pull request #48: docs: add usage/design/install/contribute/FAQ docs & modify README

2020-12-07 Thread GitBox


gxthrj commented on a change in pull request #48:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/48#discussion_r538048793



##
File path: README.md
##
@@ -2,7 +2,16 @@
 
 Use Apache APISIX for Kubernetes 
[Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/)
 
-Configure [plugins](https://github.com/apache/apisix/tree/master/doc/plugins), 
load balancing and more in Apache APISIX for Kubernetes Services, support 
service registration discovery mechanism for upstreams. All using Custom 
Resource Definitions (CRDs).
+In `apisix-ingress-controller`, all using Custom Resource Definitions (CRDs). 
Such as configure 
[plugins](https://github.com/apache/apisix/tree/master/doc/plugins), upport 
service registration discovery mechanism for upstreams, load balancing and more 
in Apache APISIX.
+
+Compared with other ingress controllers, `apisix-ingress-controller` have 
solved several obvious problems.
+
+* Dynamically update the configuration, no need to reload.

Review comment:
   Remove the compare with other ingress controller





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[apisix-ingress-controller] branch kv/docs updated (0fcd3fd -> d53868b)

2020-12-07 Thread kvn
This is an automated email from the ASF dual-hosted git repository.

kvn pushed a change to branch kv/docs
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git.


from 0fcd3fd  doc: change docs/develop.md to english
 add d53868b  doc: remove compare with other ingress controller

No new revisions were added by this update.

Summary of changes:
 README.md | 7 ---
 1 file changed, 7 deletions(-)



[GitHub] [apisix] tokers commented on a change in pull request #2926: feat: server info

2020-12-07 Thread GitBox


tokers commented on a change in pull request #2926:
URL: https://github.com/apache/apisix/pull/2926#discussion_r538046568



##
File path: apisix/plugins/server-info.lua
##
@@ -0,0 +1,238 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements.  See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License.  You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+local require = require
+local core = require("apisix.core")
+local timers = require("apisix.timers")
+
+local ngx_time = ngx.time
+local ngx_timer_at = ngx.timer.at
+local type = type
+local ceil = math.ceil
+
+local boot_time = os.time()
+local plugin_name = "server-info"
+local schema = {
+type = "object",
+additionalProperties = false,
+}
+local attr_schema = {
+type = "object",
+properties = {
+report_interval = {
+type = "integer",
+description = "server info reporting interval (unit: second)",
+default = 60,
+minimum = 60,
+maximum = 3600,
+},
+report_ttl = {
+type = "integer",
+description = "live time for server info in etcd",
+default = 7200,
+minimum = 3600,
+maximum = 86400,
+}
+}
+}
+
+local internal_status = ngx.shared.internal_status
+if not internal_status then
+error("lua_shared_dict \"internal_status\" not configured")
+end
+
+
+local _M = {
+version = 0.1,
+priority = 990,
+name = plugin_name,
+schema = schema,
+}
+
+
+local function uninitialized_server_info()
+return {
+etcd_version = "unknown",
+hostname = core.utils.gethostname(),
+id   = core.id.get(),
+version  = core.version.VERSION,
+up_time  = ngx_time() - boot_time,
+boot_time= boot_time,
+last_report_time = -1,
+}
+end
+
+
+-- server information will be saved into shared memory only if the key
+-- "server_info" not exist if excl is true.
+local function save(data, excl)
+local handler = excl and internal_status.add or internal_status.set
+
+local ok, err = handler(internal_status, "server_info", data)
+if not ok then
+if excl and err == "exists" then
+return true
+end
+
+return nil, err
+end
+
+return true
+end
+
+
+local function encode_and_save(server_info, excl)
+local data, err = core.json.encode(server_info)
+if not data then
+return nil, err
+end
+
+return save(data, excl)
+end
+
+
+local function get()
+local data, err = internal_status:get("server_info")
+if err ~= nil then
+return nil, err
+end
+
+if not data then
+return uninitialized_server_info()
+end
+
+local server_info, err = core.json.decode(data)
+if not server_info then
+return nil, err
+end
+
+server_info.up_time = ngx_time() - server_info.boot_time
+return server_info
+end
+
+
+local function report(premature, report_ttl)
+if premature then
+return
+end
+
+local server_info, err = get()
+if not server_info then
+core.log.error("failed to get server_info: ", err)
+return
+end
+
+if server_info.etcd_version == "unknown" then
+local res, err = core.etcd.server_version()
+if not res then
+core.log.error("failed to fetch etcd version: ", err)
+return
+
+elseif type(res.body) ~= "table" then
+core.log.error("failed to fetch etcd version: bad version info")
+return
+
+else
+server_info.etcd_version = res.body.etcdcluster
+end
+end
+
+server_info.last_report_time = ngx_time()
+
+local data, err = core.json.encode(server_info)
+if not data then
+core.log.error("failed to encode server_info: ", err)
+return
+end
+
+local key = "/data_plane/server_info/" .. server_info.id
+local ok, err = core.etcd.set(key, data, report_ttl)
+if not ok then
+core.log.error("failed to report server info to etcd: ", err)
+return
+end
+
+local ok, err = save(data, false)
+if not ok then
+core.log.error("failed to encode and save server info: ", err)
+return
+end
+end
+
+
+function 

[GitHub] [apisix] tokers commented on a change in pull request #2926: feat: server info

2020-12-07 Thread GitBox


tokers commented on a change in pull request #2926:
URL: https://github.com/apache/apisix/pull/2926#discussion_r538045822



##
File path: doc/plugins/server-info.md
##
@@ -0,0 +1,104 @@
+
+
+- [中文](../zh-cn/plugins/server-info.md)
+
+# Summary
+
+- [**Name**](#name)
+- [**Attributes**](#attributes)
+- [API](#api)
+- [**How To Enable**](#how-to-enable)
+- [**Test Plugin**](#test-plugin)
+- [**Disable Plugin**](#disable-plugin)
+
+## Name
+
+`server-info` is a plugin that reports basic server information to etcd 
periodically.
+
+The meaning of each item in server information is following:
+
+| Name| Type | Description |
+|-|--|-|
+| up_time | integer | Elapsed time since APISIX instance was launched, value 
will be reset when you hot updating APISIX but is kept for intact if you just 
reloading APISIX. |
+| boot_time | integer | Bootstrap timestamp of the APISIX instance, value will 
be reset when you hot updating APISIX but is kept for intact if you just 
reloading APISIX. |

Review comment:
   Previously, workers will try to write server info to shdict in the 
init_worker phase, only when the key "server_info" doesn't exist, so server 
info written by old worker will not be overwritten by new workers, that is to 
say, the boot time will not be changed.





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] spacewander closed issue #2827: request help: fault-injection abort.body Using variables

2020-12-07 Thread GitBox


spacewander closed issue #2827:
URL: https://github.com/apache/apisix/issues/2827


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[apisix] branch master updated (6cd780c -> 7907500)

2020-12-07 Thread spacewander
This is an automated email from the ASF dual-hosted git repository.

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


from 6cd780c  feat: install lua-resty-hmac-ffi (#2981)
 add 7907500  feat(fault-injection): support Nginx variable in abort.body 
(#2986)

No new revisions were added by this update.

Summary of changes:
 apisix/core/utils.lua|  41 ++
 apisix/plugins/fault-injection.lua   |  16 ++
 doc/plugins/fault-injection.md   |   6 +-
 doc/zh-cn/plugins/fault-injection.md |   6 +-
 t/core/utils.t   |  40 +
 t/plugin/fault-injection.t   | 106 +++
 6 files changed, 198 insertions(+), 17 deletions(-)



[GitHub] [apisix] spacewander merged pull request #2986: feat(fault-injection): support Nginx variable in abort.body

2020-12-07 Thread GitBox


spacewander merged pull request #2986:
URL: https://github.com/apache/apisix/pull/2986


   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-ingress-controller] tokers commented on a change in pull request #48: docs: add usage/design/install/contribute/FAQ docs & modify README

2020-12-07 Thread GitBox


tokers commented on a change in pull request #48:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/48#discussion_r537985950



##
File path: README.md
##
@@ -2,7 +2,16 @@
 
 Use Apache APISIX for Kubernetes 
[Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/)
 
-Configure [plugins](https://github.com/apache/apisix/tree/master/doc/plugins), 
load balancing and more in Apache APISIX for Kubernetes Services, support 
service registration discovery mechanism for upstreams. All using Custom 
Resource Definitions (CRDs).
+In `apisix-ingress-controller`, all using Custom Resource Definitions (CRDs). 
Such as configure 
[plugins](https://github.com/apache/apisix/tree/master/doc/plugins), upport 
service registration discovery mechanism for upstreams, load balancing and more 
in Apache APISIX.
+
+Compared with other ingress controllers, `apisix-ingress-controller` have 
solved several obvious problems.
+
+* Dynamically update the configuration, no need to reload.

Review comment:
   What about:
   
   Dynamically update the configuration without reloading.

##
File path: README.md
##
@@ -2,7 +2,16 @@
 
 Use Apache APISIX for Kubernetes 
[Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/)
 
-Configure [plugins](https://github.com/apache/apisix/tree/master/doc/plugins), 
load balancing and more in Apache APISIX for Kubernetes Services, support 
service registration discovery mechanism for upstreams. All using Custom 
Resource Definitions (CRDs).
+In `apisix-ingress-controller`, all using Custom Resource Definitions (CRDs). 
Such as configure 
[plugins](https://github.com/apache/apisix/tree/master/doc/plugins), upport 
service registration discovery mechanism for upstreams, load balancing and more 
in Apache APISIX.

Review comment:
   typo: upport -> support.

##
File path: docs/design.md
##
@@ -36,6 +36,88 @@ Apache APISIX ingress for Kubernetes.
 
 - match and covert Apisix-ingress-types to Apisix-types before handing the 
control over to the above module seven;
 
-## Sequence Diagram
+## CRD design
 
-![Sequence Diagram](../images/flow.png)
+Currently `apisix-ingress-controller` CRDs consist of 3 parts: 
ApisixRoute/ApisixService/ApisixUpstream. The design follows the following 
ideas.
+
+1. The most important part of the gateway is the route part, which is used to 
define the distribution rules of the gateway traffics.
+2. In order to facilitate understanding and configuration, the design 
structure of `ApisixRoute` is basically similar to Kubernetes Ingress.
+3. In the design of annotation, the structure of Kubernetes Ingress is used 
for reference, but the internal implementation is based on the plug-in of 
Apache APISIX.
+4. Both `ApisixRoute` and `ApisixService` can be bound to plug-ins, which is 
consistent with Apache APISIX.
+5. In the simplest case, you only need to define `ApisixRoute`, and the 
Ingress controller will automatically add `ApisixService` and `ApisixUpstream`.
+6. `ApisixService`, like Apache APISIX service, is a grouping of routes, which 
can simplify the configuration complexity of the same plug-in.
+7. `ApisixUpstream` can define some details on Apache APISIX upstream, such as 
load balancing/health check, etc.
+
+## Monitoring CRDs
+
+`apisix-ingress-controller` is responsible for interacting with the Kubernetes 
Apiserver, applying for accessible resource permissions (RBAC), monitoring 
changes, and implementing object conversion within the Ingress controller, 
comparing the changes, and then synchronizing to Apache APISIX.
+
+### Timing diagram
+
+![flow](./images/flow.png)
+
+### Conversion structure
+
+`apisix-ingress-controller` provides external configuration methods for CRDs. 
It is aimed at operators such as daily operation and maintenance, who often 
need to process a large number of routes in batches, hoping to handle all 
related services in the same configuration file, and at the same time have 
convenient and understandable management capabilities. Apache APISIX is 
designed from the perspective of the gateway, and all routes are independent. 
This leads to obvious differences in the data structure between the two. One 
focuses on batch definition, while the other is discrete implementation.
+
+Taking into account the usage habits of different groups of people, the data 
structure of CRDs draws on the data structure of Kubernetes Ingress, and is 
basically the same in shape.
+
+A simple comparison is as follows, they have different definitions:
+
+![strut-compare](./images/struct-compare.png)
+
+They are a many-to-many relationship.Therefore, `apisix-ingress-controller` 
has to do some conversion of CRDs to adapt to different gateways.
+
+### Cascade update
+
+At present, we have defined multiple CRDs, and these CRDs are responsible for 
the definition of their respective fields. `ApisixRoute`/ `ApisixService` / 
`ApisixUpstream` correspond to objects 

[GitHub] [apisix-dashboard] moonming commented on a change in pull request #982: draft: add frontend e2e test for create route

2020-12-07 Thread GitBox


moonming commented on a change in pull request #982:
URL: https://github.com/apache/apisix-dashboard/pull/982#discussion_r538041881



##
File path: web/src/e2e/Route.e2e.js
##
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* eslint-disable import/no-extraneous-dependencies */
+const puppeteer = require('puppeteer');
+
+const {
+  setupLogin,
+  BASE_URL
+} = require('./service')
+
+let browser;
+const domSelectors = {
+  input_routename: '#name',
+  input_routepath: '#uris_0',
+  input_node_host: '#nodes_0_host',
+  input_node_port: '#nodes_0_port',
+  input_node_weight: '#nodes_0_weight',
+  routelist:'.ant-layout-sider-children ul li:nth-child(2)',
+  button_createroute:'.ant-pro-table-toolbar-option button',
+  button_next:'.ant-row-end .ant-col:nth-child(2)'
+};
+
+describe('Route', () => {
+
+  beforeAll(async () => {
+browser = await puppeteer.launch({
+  headless: false,

Review comment:
   why not headless?





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] moonming commented on pull request #982: draft: add frontend e2e test for create route

2020-12-07 Thread GitBox


moonming commented on pull request #982:
URL: https://github.com/apache/apisix-dashboard/pull/982#issuecomment-740381246


   why e2e test cases in “src” dir?



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] juzhiyuan commented on pull request #949: feat: added info page

2020-12-07 Thread GitBox


juzhiyuan commented on pull request #949:
URL: https://github.com/apache/apisix-dashboard/pull/949#issuecomment-740376380


   ## APIs
   
   ### Fetch Node List
   TODO
   
   ### Fetch Node Detail
   ```json
   {
   "id": "ddea4053-4ffd-4f09-b176-b8c5e919916b",
   "hostname": "localhost.local",
   "version": "2.0",
   "etcd_version": "3.5.0",
   "uptime": 3600,
   "last_report_at": 1606121591,
   "boot_time": 1606121501
   }
   ```



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] idbeta opened a new pull request #982: draft: add frontend e2e test for create route

2020-12-07 Thread GitBox


idbeta opened a new pull request #982:
URL: https://github.com/apache/apisix-dashboard/pull/982


   fixed #975
   
   Please answer these questions before submitting a pull request
   
   - Why submit this pull request?
   - [x] Frontend E2E test
   - [ ] New feature provided
   - [ ] Improve performance
   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #977: chore: enrich error log

2020-12-07 Thread GitBox


codecov-io edited a comment on pull request #977:
URL: https://github.com/apache/apisix-dashboard/pull/977#issuecomment-739972588


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/977?src=pr=h1) 
Report
   > Merging 
[#977](https://codecov.io/gh/apache/apisix-dashboard/pull/977?src=pr=desc) 
(95a6157) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/8976cca55972b7ba8686843bd51241cbc3e1554c?el=desc)
 (8976cca) will **increase** coverage by `0.04%`.
   > The diff coverage is `24.13%`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/977/graphs/tree.svg?width=650=150=pr=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/977?src=pr=tree)
   
   ```diff
   @@Coverage Diff @@
   ##   master #977  +/-   ##
   ==
   + Coverage   43.41%   43.46%   +0.04% 
   ==
 Files  18   18  
 Lines1299 1300   +1 
   ==
   + Hits  564  565   +1 
 Misses643  643  
 Partials   92   92  
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-dashboard/pull/977?src=pr=tree) | 
Coverage Δ | |
   |---|---|---|
   | 
[api/internal/core/entity/format.go](https://codecov.io/gh/apache/apisix-dashboard/pull/977/diff?src=pr=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2Zvcm1hdC5nbw==)
 | `60.46% <0.00%> (ø)` | |
   | 
[api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/977/diff?src=pr=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=)
 | `0.00% <0.00%> (ø)` | |
   | 
[api/internal/core/store/validate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/977/diff?src=pr=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvdmFsaWRhdGUuZ28=)
 | `57.63% <0.00%> (-0.41%)` | :arrow_down: |
   | 
[api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/977/diff?src=pr=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=)
 | `79.22% <63.63%> (+0.64%)` | :arrow_up: |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/977?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/977?src=pr=footer).
 Last update 
[8976cca...95a6157](https://codecov.io/gh/apache/apisix-dashboard/pull/977?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] spacewander commented on a change in pull request #2964: feat: route accroding to the graphql attributes

2020-12-07 Thread GitBox


spacewander commented on a change in pull request #2964:
URL: https://github.com/apache/apisix/pull/2964#discussion_r538018558



##
File path: t/lib/test_admin.lua
##
@@ -108,14 +108,15 @@ function _M.comp_tab(left_tab, right_tab)
 local err
 dir_names = {}
 
+local _
 if type(left_tab) == "string" then
-left_tab, err = json.decode(left_tab)
+left_tab, _, err = json.decode(left_tab)

Review comment:
   @membphis 
   For dkjson, the second argument is `pos`, not `err`.





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on a change in pull request #2964: feat: route accroding to the graphql attributes

2020-12-07 Thread GitBox


membphis commented on a change in pull request #2964:
URL: https://github.com/apache/apisix/pull/2964#discussion_r538009201



##
File path: apisix/core/ctx.lua
##
@@ -84,6 +158,10 @@ do
 key = re_gsub(key, "-", "_", "jo")
 val = get_var(key, t._request)
 
+elseif core_str.has_prefix(key, "graphql_") then
+key = sub_str(key, 9)

Review comment:
   magic number, need comment

##
File path: apisix/core/ctx.lua
##
@@ -15,22 +15,96 @@
 -- limitations under the License.
 --
 local core_str = require("apisix.core.string")
+local core_tab = require("apisix.core.table")
+local request  = require("apisix.core.request")
 local log  = require("apisix.core.log")
+local config_local = require("apisix.core.config_local")
 local tablepool= require("tablepool")
 local get_var  = require("resty.ngxvar").fetch
 local get_request  = require("resty.ngxvar").request
 local ck   = require "resty.cookie"
+local gq_parse = require("graphql").parse
 local setmetatable = setmetatable
 local sub_str  = string.sub
 local rawset   = rawset
+local ngx  = ngx
 local ngx_var  = ngx.var
 local re_gsub  = ngx.re.gsub
+local ipairs   = ipairs
 local type = type
 local error= error
-local ngx  = ngx
+local pcall= pcall
 
 
 local _M = {version = 0.2}
+local GRAPHQL_DEFAULT_MAX_SIZE = 1048576   -- 1MiB
+
+
+local function parse_graphql(ctx)
+local local_conf, err = config_local.local_conf()
+if not local_conf then
+return nil, "failed to get local conf: " .. err
+end
+
+local max_size = GRAPHQL_DEFAULT_MAX_SIZE
+local size = core_tab.try_read_attr(local_conf, "graphql", "max_size")
+if size then
+max_size = size
+end
+
+local body, err = request.get_body(max_size, ctx)
+if not body then
+return nil, "failed to read graphql body: " .. err
+end
+
+local ok, res = pcall(gq_parse, body)
+if not ok then
+return nil, "failed to parse graphql: " .. res .. " body: " .. body
+end
+
+if #res.definitions == 0 then
+return nil, "empty graphql: " .. body
+end
+
+return res, nil

Review comment:
   `return  res` be fine

##
File path: t/lib/test_admin.lua
##
@@ -108,14 +108,15 @@ function _M.comp_tab(left_tab, right_tab)
 local err
 dir_names = {}
 
+local _
 if type(left_tab) == "string" then
-left_tab, err = json.decode(left_tab)
+left_tab, _, err = json.decode(left_tab)

Review comment:
   where to get this API manual?
   
   the new way seems wrong. I think the correct style should be `local res, err 
= json.decode(str)`

##
File path: apisix/core/ctx.lua
##
@@ -15,22 +15,96 @@
 -- limitations under the License.
 --
 local core_str = require("apisix.core.string")
+local core_tab = require("apisix.core.table")
+local request  = require("apisix.core.request")
 local log  = require("apisix.core.log")
+local config_local = require("apisix.core.config_local")
 local tablepool= require("tablepool")
 local get_var  = require("resty.ngxvar").fetch
 local get_request  = require("resty.ngxvar").request
 local ck   = require "resty.cookie"
+local gq_parse = require("graphql").parse
 local setmetatable = setmetatable
 local sub_str  = string.sub
 local rawset   = rawset
+local ngx  = ngx
 local ngx_var  = ngx.var
 local re_gsub  = ngx.re.gsub
+local ipairs   = ipairs
 local type = type
 local error= error
-local ngx  = ngx
+local pcall= pcall
 
 
 local _M = {version = 0.2}
+local GRAPHQL_DEFAULT_MAX_SIZE = 1048576   -- 1MiB
+
+
+local function parse_graphql(ctx)
+local local_conf, err = config_local.local_conf()
+if not local_conf then
+return nil, "failed to get local conf: " .. err
+end
+
+local max_size = GRAPHQL_DEFAULT_MAX_SIZE
+local size = core_tab.try_read_attr(local_conf, "graphql", "max_size")
+if size then
+max_size = size
+end
+
+local body, err = request.get_body(max_size, ctx)
+if not body then
+return nil, "failed to read graphql body: " .. err
+end
+
+local ok, res = pcall(gq_parse, body)
+if not ok then
+return nil, "failed to parse graphql: " .. res .. " body: " .. body
+end
+
+if #res.definitions == 0 then
+return nil, "empty graphql: " .. body
+end
+
+return res, nil
+end
+
+
+local function get_parsed_graphql(ctx)
+if not ctx._graphql then
+local res, err = parse_graphql(ctx)
+if not res then
+log.error(err)
+ctx._graphql = {}
+

Review comment:
   return directly





This is an automated message from the Apache Git Service.
To respond to 

[GitHub] [apisix] spacewander commented on a change in pull request #2926: feat: server info

2020-12-07 Thread GitBox


spacewander commented on a change in pull request #2926:
URL: https://github.com/apache/apisix/pull/2926#discussion_r538009963



##
File path: doc/plugins/server-info.md
##
@@ -0,0 +1,104 @@
+
+
+- [中文](../zh-cn/plugins/server-info.md)
+
+# Summary
+
+- [**Name**](#name)
+- [**Attributes**](#attributes)
+- [API](#api)
+- [**How To Enable**](#how-to-enable)
+- [**Test Plugin**](#test-plugin)
+- [**Disable Plugin**](#disable-plugin)
+
+## Name
+
+`server-info` is a plugin that reports basic server information to etcd 
periodically.
+
+The meaning of each item in server information is following:
+
+| Name| Type | Description |
+|-|--|-|
+| up_time | integer | Elapsed time since APISIX instance was launched, value 
will be reset when you hot updating APISIX but is kept for intact if you just 
reloading APISIX. |
+| boot_time | integer | Bootstrap timestamp of the APISIX instance, value will 
be reset when you hot updating APISIX but is kept for intact if you just 
reloading APISIX. |

Review comment:
   When reloading Nginx, there will be two workers A and B. B is just 
created and has a later boot time, but both workers share the same shdict.





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] ShiningRush commented on a change in pull request #900: feat: add version info into manager-api

2020-12-07 Thread GitBox


ShiningRush commented on a change in pull request #900:
URL: https://github.com/apache/apisix-dashboard/pull/900#discussion_r538008577



##
File path: api/build.sh
##
@@ -19,6 +19,9 @@ set -ex
 export ENV=local
 pwd=`pwd`
 
+VERSION=$(cat ./api/VERSION)

Review comment:
   Code is same is not enough, user could build it with different build tag 
and option(such as enable static link and disable cgo 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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] spacewander commented on a change in pull request #2926: feat: server info

2020-12-07 Thread GitBox


spacewander commented on a change in pull request #2926:
URL: https://github.com/apache/apisix/pull/2926#discussion_r538007869



##
File path: apisix/plugins/server-info.lua
##
@@ -0,0 +1,238 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements.  See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License.  You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+local require = require
+local core = require("apisix.core")
+local timers = require("apisix.timers")
+
+local ngx_time = ngx.time
+local ngx_timer_at = ngx.timer.at
+local type = type
+local ceil = math.ceil
+
+local boot_time = os.time()
+local plugin_name = "server-info"
+local schema = {
+type = "object",
+additionalProperties = false,
+}
+local attr_schema = {
+type = "object",
+properties = {
+report_interval = {
+type = "integer",
+description = "server info reporting interval (unit: second)",
+default = 60,
+minimum = 60,
+maximum = 3600,
+},
+report_ttl = {
+type = "integer",
+description = "live time for server info in etcd",
+default = 7200,
+minimum = 3600,
+maximum = 86400,
+}
+}
+}
+
+local internal_status = ngx.shared.internal_status
+if not internal_status then
+error("lua_shared_dict \"internal_status\" not configured")
+end
+
+
+local _M = {
+version = 0.1,
+priority = 990,
+name = plugin_name,
+schema = schema,
+}
+
+
+local function uninitialized_server_info()
+return {
+etcd_version = "unknown",
+hostname = core.utils.gethostname(),
+id   = core.id.get(),
+version  = core.version.VERSION,
+up_time  = ngx_time() - boot_time,
+boot_time= boot_time,
+last_report_time = -1,
+}
+end
+
+
+-- server information will be saved into shared memory only if the key
+-- "server_info" not exist if excl is true.
+local function save(data, excl)
+local handler = excl and internal_status.add or internal_status.set
+
+local ok, err = handler(internal_status, "server_info", data)
+if not ok then
+if excl and err == "exists" then
+return true
+end
+
+return nil, err
+end
+
+return true
+end
+
+
+local function encode_and_save(server_info, excl)
+local data, err = core.json.encode(server_info)
+if not data then
+return nil, err
+end
+
+return save(data, excl)
+end
+
+
+local function get()
+local data, err = internal_status:get("server_info")
+if err ~= nil then
+return nil, err
+end
+
+if not data then
+return uninitialized_server_info()
+end
+
+local server_info, err = core.json.decode(data)
+if not server_info then
+return nil, err
+end
+
+server_info.up_time = ngx_time() - server_info.boot_time
+return server_info
+end
+
+
+local function report(premature, report_ttl)
+if premature then
+return
+end
+
+local server_info, err = get()
+if not server_info then
+core.log.error("failed to get server_info: ", err)
+return
+end
+
+if server_info.etcd_version == "unknown" then
+local res, err = core.etcd.server_version()
+if not res then
+core.log.error("failed to fetch etcd version: ", err)
+return
+
+elseif type(res.body) ~= "table" then
+core.log.error("failed to fetch etcd version: bad version info")
+return
+
+else
+server_info.etcd_version = res.body.etcdcluster
+end
+end
+
+server_info.last_report_time = ngx_time()
+
+local data, err = core.json.encode(server_info)
+if not data then
+core.log.error("failed to encode server_info: ", err)
+return
+end
+
+local key = "/data_plane/server_info/" .. server_info.id
+local ok, err = core.etcd.set(key, data, report_ttl)
+if not ok then
+core.log.error("failed to report server info to etcd: ", err)
+return
+end
+
+local ok, err = save(data, false)
+if not ok then
+core.log.error("failed to encode and save server info: ", err)
+return
+end
+end
+
+
+function 

[GitHub] [apisix] spacewander opened a new pull request #2990: fix: avoid unnecessary type check and support var in local_conf

2020-12-07 Thread GitBox


spacewander opened a new pull request #2990:
URL: https://github.com/apache/apisix/pull/2990


   Also merge bundle of repeated code.
   
   Signed-off-by: spacewander 
   
   ### What this PR does / why we need it:
   
   
   
   ### Pre-submission checklist:
   
   * [ ] Did you explain what problem does this PR solve? Or what new features 
have been added?
   * [x] Have you added corresponding test cases?
   * [ ] Have you modified the corresponding document?
   * [x] Is this PR backward compatible? **If it is not backward compatible, 
please discuss on the [mailing 
list](https://github.com/apache/apisix/tree/master#community) first**
   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] ShiningRush commented on a change in pull request #900: feat: add version info into manager-api

2020-12-07 Thread GitBox


ShiningRush commented on a change in pull request #900:
URL: https://github.com/apache/apisix-dashboard/pull/900#discussion_r538007057



##
File path: api/main.go
##
@@ -35,6 +35,16 @@ import (
"github.com/apisix/manager-api/log"
 )
 
+var Version string
+
+func printInfo() {
+   fmt.Fprint(os.Stdout, "The manager-api is running successfully!\n\n")
+   fmt.Fprintf(os.Stdout, "%-8s: %s\n", "Version", Version)
+   fmt.Fprintf(os.Stdout, "%-8s: %s:%d\n", "Listen", conf.ServerHost, 
conf.ServerPort)
+   fmt.Fprintf(os.Stdout, "%-8s: %s\n", "Loglevel", conf.ErrorLogLevel)

Review comment:
   Output listen info have two meanings:
   - Tell user, manager api is running normal
   - Show the serve info
   
   If we output the log info, why we not output other config? We should give a 
standard to tell other developer what should be print with begin info instead 
of component's log,I  think `relative path` is not reasonable.





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] nic-chen commented on issue #566: bug: need to check ID between path and body

2020-12-07 Thread GitBox


nic-chen commented on issue #566:
URL: 
https://github.com/apache/apisix-dashboard/issues/566#issuecomment-740350886


   > Unfortunately my windows computer doesn't have the capability to support 
ETCD. Sorry, looks like I can't work on this open source repo :(.
   
   @jinchizhou  It doesn't matter. but if you still have the willing you could 
contact, we could resolved it together.
   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] wfgydbu commented on issue #2985: bug: 'limit-conn' plugin seems working in an unexpected manner

2020-12-07 Thread GitBox


wfgydbu commented on issue #2985:
URL: https://github.com/apache/apisix/issues/2985#issuecomment-740349882


   Sure. I'd like to.



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] starsz commented on a change in pull request #900: feat: add version info into manager-api

2020-12-07 Thread GitBox


starsz commented on a change in pull request #900:
URL: https://github.com/apache/apisix-dashboard/pull/900#discussion_r538005078



##
File path: api/build.sh
##
@@ -19,6 +19,9 @@ set -ex
 export ENV=local
 pwd=`pwd`
 
+VERSION=$(cat ./api/VERSION)

Review comment:
   Hi, I write the `abbreviated commit hash`.
   If the commit hash is the same, we can consider the code is the same.
   





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] ShiningRush commented on a change in pull request #900: feat: add version info into manager-api

2020-12-07 Thread GitBox


ShiningRush commented on a change in pull request #900:
URL: https://github.com/apache/apisix-dashboard/pull/900#discussion_r537999422



##
File path: api/main.go
##
@@ -35,6 +35,16 @@ import (
"github.com/apisix/manager-api/log"
 )
 
+var Version string
+
+func printInfo() {
+   fmt.Fprint(os.Stdout, "The manager-api is running successfully!\n\n")

Review comment:
   This is a different line with `listen on:`, this line dose not offer any 
helpful info to user.
   The original issue demo is just only one line `manager-api is running, and 
listen on: http://127.0.0.1:8080.`
   > And -v will be implemented at #773. Manager-api need a cli scafford.
   
   Got it, but I think it would be better have a discuss before coding, here 
are many projects implement the command just using native go `flag` library, 
are we really need that?  
   
   BTW: I think `manager-api is listen on : `  would be more simple,how do 
you think? @membphis @nic-chen 





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] spacewander commented on issue #2985: bug: 'limit-conn' plugin seems working in an unexpected manner

2020-12-07 Thread GitBox


spacewander commented on issue #2985:
URL: https://github.com/apache/apisix/issues/2985#issuecomment-740346852


   @wfgydbu 
   Would you try https://github.com/apache/apisix/pull/2465/files and report if 
the issue can be fixed by this?



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #904: feat: support disable property for json schema according to APISIX's change

2020-12-07 Thread GitBox


codecov-io edited a comment on pull request #904:
URL: https://github.com/apache/apisix-dashboard/pull/904#issuecomment-735344204


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/904?src=pr=h1) 
Report
   > Merging 
[#904](https://codecov.io/gh/apache/apisix-dashboard/pull/904?src=pr=desc) 
(b6ccd4a) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/c574813eea82edcd6d95a2ea0f8857b736049717?el=desc)
 (c574813) will **increase** coverage by `0.25%`.
   > The diff coverage is `68.75%`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/904/graphs/tree.svg?width=650=150=pr=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/904?src=pr=tree)
   
   ```diff
   @@Coverage Diff @@
   ##   master #904  +/-   ##
   ==
   + Coverage   43.49%   43.75%   +0.25% 
   ==
 Files  18   18  
 Lines1299 1305   +6 
   ==
   + Hits  565  571   +6 
   - Misses642  643   +1 
   + Partials   92   91   -1 
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-dashboard/pull/904?src=pr=tree) | 
Coverage Δ | |
   |---|---|---|
   | 
[api/internal/core/store/validate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/904/diff?src=pr=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvdmFsaWRhdGUuZ28=)
 | `60.40% <68.75%> (+2.36%)` | :arrow_up: |
   | 
[api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/904/diff?src=pr=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=)
 | `78.57% <0.00%> (-0.65%)` | :arrow_down: |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/904?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/904?src=pr=footer).
 Last update 
[c574813...b6ccd4a](https://codecov.io/gh/apache/apisix-dashboard/pull/904?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] ShiningRush commented on a change in pull request #900: feat: add version info into manager-api

2020-12-07 Thread GitBox


ShiningRush commented on a change in pull request #900:
URL: https://github.com/apache/apisix-dashboard/pull/900#discussion_r537999422



##
File path: api/main.go
##
@@ -35,6 +35,16 @@ import (
"github.com/apisix/manager-api/log"
 )
 
+var Version string
+
+func printInfo() {
+   fmt.Fprint(os.Stdout, "The manager-api is running successfully!\n\n")

Review comment:
   This is a different line with `listen on:`, this line dose not offer any 
helpful info to user.
   The original issue demo is just only one line `manager-api is running, and 
listen on: http://127.0.0.1:8080.`
   > Manager-api need a cli scafford.
   
   got it.
   
   BTW: I think `manager-api is listen on : `  would be more simple,how do 
you think? @membphis @nic-chen 

##
File path: api/main.go
##
@@ -35,6 +35,16 @@ import (
"github.com/apisix/manager-api/log"
 )
 
+var Version string
+
+func printInfo() {
+   fmt.Fprint(os.Stdout, "The manager-api is running successfully!\n\n")

Review comment:
   This is a different line with `listen on:`, this line dose not offer any 
helpful info to user.
   The original issue demo is just only one line `manager-api is running, and 
listen on: http://127.0.0.1:8080.`
   > And -v will be implemented at #773. Manager-api need a cli scafford.
   
   got it.
   
   BTW: I think `manager-api is listen on : `  would be more simple,how do 
you think? @membphis @nic-chen 





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] wfgydbu commented on issue #2985: bug: 'limit-conn' plugin seems working in an unexpected manner

2020-12-07 Thread GitBox


wfgydbu commented on issue #2985:
URL: https://github.com/apache/apisix/issues/2985#issuecomment-740344661


   
https://github.com/apache/apisix/blob/v2.1/apisix/plugins/limit-conn.lua#L88-L94
   
   I think these code should be something like this:
   ```
   if lim:is_committed() then
   if not ctx.limit_conn then
   ctx.limit_conn = core.tablepool.fetch("plugin#limit-conn", 0, 6)
   
   core.table.insert_tail(ctx.limit_conn, lim, key, delay)
   end
   end
   ```



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] ShiningRush commented on a change in pull request #900: feat: add version info into manager-api

2020-12-07 Thread GitBox


ShiningRush commented on a change in pull request #900:
URL: https://github.com/apache/apisix-dashboard/pull/900#discussion_r537999422



##
File path: api/main.go
##
@@ -35,6 +35,16 @@ import (
"github.com/apisix/manager-api/log"
 )
 
+var Version string
+
+func printInfo() {
+   fmt.Fprint(os.Stdout, "The manager-api is running successfully!\n\n")

Review comment:
   This is a different line with `listen on:`, this line dose not offer any 
helpful info to user.
   The original issues demo is just only one line `manager-api is running, and 
listen on: http://127.0.0.1:8080.`
   BTW: I think `manager-api is listen on : `  would be more simple,how do 
you think? @membphis @nic-chen 





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] ziyou434 opened a new issue #2989: bug: Route url

2020-12-07 Thread GitBox


ziyou434 opened a new issue #2989:
URL: https://github.com/apache/apisix/issues/2989


   ### Issue description
   when I set url: "/index.html" ,there is nothing wrong.
   But I set url: "foo/index.html" or "foo/bar/index.html", it will give me 
{"error_msg":"failed to match any routes"}.
   Is it controled by route's rules , or it's a bug?
   
   ### Environment
   
   * apisix version (cmd: `apisix version`): 2.1
   * OS: centos7
   
   
   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] ShiningRush commented on a change in pull request #900: feat: add version info into manager-api

2020-12-07 Thread GitBox


ShiningRush commented on a change in pull request #900:
URL: https://github.com/apache/apisix-dashboard/pull/900#discussion_r537995851



##
File path: api/build.sh
##
@@ -19,6 +19,9 @@ set -ex
 export ENV=local
 pwd=`pwd`
 
+VERSION=$(cat ./api/VERSION)

Review comment:
   If here are many branch, how do you know to which branch the git version 
belong?
   Build date can help to check the binary is build by ours or user.





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] starsz commented on a change in pull request #900: feat: add version info into manager-api

2020-12-07 Thread GitBox


starsz commented on a change in pull request #900:
URL: https://github.com/apache/apisix-dashboard/pull/900#discussion_r537997032



##
File path: api/main.go
##
@@ -35,6 +35,16 @@ import (
"github.com/apisix/manager-api/log"
 )
 
+var Version string
+
+func printInfo() {
+   fmt.Fprint(os.Stdout, "The manager-api is running successfully!\n\n")
+   fmt.Fprintf(os.Stdout, "%-8s: %s\n", "Version", Version)
+   fmt.Fprintf(os.Stdout, "%-8s: %s:%d\n", "Listen", conf.ServerHost, 
conf.ServerPort)
+   fmt.Fprintf(os.Stdout, "%-8s: %s\n", "Loglevel", conf.ErrorLogLevel)

Review comment:
   The listen info is also described in the config file. But we show it.
   So I think it's more convenient for users to get the log file path location 
if the file path is described in `relative path` format.





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] tokers edited a comment on issue #2821: Implement status API

2020-12-07 Thread GitBox


tokers edited a comment on issue #2821:
URL: https://github.com/apache/apisix/issues/2821#issuecomment-732206604


   OK, let's just add the most basic fields now:
   
   ```json
   {
   "id": "ddea4053-4ffd-4f09-b176-b8c5e919916b",
   "hostname": "localhost.local",
   "version": "2.0",
   "etcd_version": "3.5.0",
   "uptime": 3600,
   "last_report_at": 1606121591,
   "boot_time": 1606121501
   }
   ```



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] ShiningRush commented on a change in pull request #900: feat: add version info into manager-api

2020-12-07 Thread GitBox


ShiningRush commented on a change in pull request #900:
URL: https://github.com/apache/apisix-dashboard/pull/900#discussion_r537995851



##
File path: api/build.sh
##
@@ -19,6 +19,9 @@ set -ex
 export ENV=local
 pwd=`pwd`
 
+VERSION=$(cat ./api/VERSION)

Review comment:
   If here are many branch, how do you know to which branch the git version 
belong?





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-ingress-controller] Bhanuji95 edited a comment on issue #33: I execute the yaml file in k8s and report such an error in the log on the controller

2020-12-07 Thread GitBox


Bhanuji95 edited a comment on issue #33:
URL: 
https://github.com/apache/apisix-ingress-controller/issues/33#issuecomment-740326084


   Hi, I removed admin_key and used allow_admin settings as you suggested, but 
then the log message says **admin_key is missing**. Can you please suggest  
anything for my issue.



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] starsz commented on a change in pull request #900: feat: add version info into manager-api

2020-12-07 Thread GitBox


starsz commented on a change in pull request #900:
URL: https://github.com/apache/apisix-dashboard/pull/900#discussion_r537994568



##
File path: api/main.go
##
@@ -35,6 +35,16 @@ import (
"github.com/apisix/manager-api/log"
 )
 
+var Version string
+
+func printInfo() {
+   fmt.Fprint(os.Stdout, "The manager-api is running successfully!\n\n")

Review comment:
   Sorry for the PR title. It's not only the version info. It also fixes 
#853.
   And `-v` will be implemented at 
https://github.com/apache/apisix-dashboard/pull/773. Manager-api need a cli 
scafford.





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-ingress-controller] Bhanuji95 edited a comment on issue #33: I execute the yaml file in k8s and report such an error in the log on the controller

2020-12-07 Thread GitBox


Bhanuji95 edited a comment on issue #33:
URL: 
https://github.com/apache/apisix-ingress-controller/issues/33#issuecomment-740326084


   Hi, I removed admin_key and used allow_admin settings as you suggested, but 
then the log message says **admin_key is missing**. Can you please suggest  
anything here.



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] starsz commented on a change in pull request #900: feat: add version info into manager-api

2020-12-07 Thread GitBox


starsz commented on a change in pull request #900:
URL: https://github.com/apache/apisix-dashboard/pull/900#discussion_r537993157



##
File path: api/build.sh
##
@@ -19,6 +19,9 @@ set -ex
 export ENV=local
 pwd=`pwd`
 
+VERSION=$(cat ./api/VERSION)

Review comment:
   I agree with add go version. But why are branch name and build date 
useful, since we had git commit info.
   
   In fact, I refer the 
[mosn](https://github.com/mosn/mosn/blob/2adbcbc57994288fa4bdeb86bf43973443233a0b/Makefile#L94)





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-ingress-controller] Bhanuji95 commented on issue #33: I execute the yaml file in k8s and report such an error in the log on the controller

2020-12-07 Thread GitBox


Bhanuji95 commented on issue #33:
URL: 
https://github.com/apache/apisix-ingress-controller/issues/33#issuecomment-740326084


   Hi, I removed admin_key and used allow_admin settings as you suggested, but 
then the log message says **admin_key is missing**.



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] juzhiyuan opened a new pull request #981: feat(CI): supoort markdown links checker

2020-12-07 Thread GitBox


juzhiyuan opened a new pull request #981:
URL: https://github.com/apache/apisix-dashboard/pull/981


   Please answer these questions before submitting a pull request
   
   - Why submit this pull request?
   - [ ] Bugfix
   - [x] New feature provided
   - [ ] Improve performance
   
   - Related issues
   None



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[apisix-dashboard] 01/01: feat(CI): supoort markdown links checker

2020-12-07 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

juzhiyuan pushed a commit to branch juzhiyuan-patch-1
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git

commit 59bee2220a0bb9c8619b6f1a9a819b2f5d1fc78a
Author: 琚致远 
AuthorDate: Tue Dec 8 10:28:40 2020 +0800

feat(CI): supoort markdown links checker
---
 .github/workflows/markdown-link-checker.yml | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/.github/workflows/markdown-link-checker.yml 
b/.github/workflows/markdown-link-checker.yml
new file mode 100644
index 000..c89a81e
--- /dev/null
+++ b/.github/workflows/markdown-link-checker.yml
@@ -0,0 +1,14 @@
+name: Check markdown links
+
+on: push
+
+jobs:
+  markdown-link-check:
+runs-on: ubuntu-latest
+steps:
+- uses: actions/checkout@master
+- uses: gaurav-nelson/github-action-markdown-link-check@v1
+  with:
+use-quiet-mode: 'yes'
+use-verbose-mode: 'yes'
+check-modified-files-only: 'yes'



[apisix-dashboard] branch juzhiyuan-patch-1 created (now 59bee22)

2020-12-07 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

juzhiyuan pushed a change to branch juzhiyuan-patch-1
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git.


  at 59bee22  feat(CI): supoort markdown links checker

This branch includes the following new commits:

 new 59bee22  feat(CI): supoort markdown links checker

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #970: docs: optimize metrics document

2020-12-07 Thread GitBox


codecov-io edited a comment on pull request #970:
URL: https://github.com/apache/apisix-dashboard/pull/970#issuecomment-739443961


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/970?src=pr=h1) 
Report
   > Merging 
[#970](https://codecov.io/gh/apache/apisix-dashboard/pull/970?src=pr=desc) 
(0831752) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/c574813eea82edcd6d95a2ea0f8857b736049717?el=desc)
 (c574813) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-dashboard/pull/970/graphs/tree.svg?width=650=150=pr=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/970?src=pr=tree)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master #970   +/-   ##
   ===
 Coverage   43.49%   43.49%   
   ===
 Files  18   18   
 Lines1299 1299   
   ===
 Hits  565  565   
 Misses642  642   
 Partials   92   92   
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/970?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/970?src=pr=footer).
 Last update 
[c574813...6326a68](https://codecov.io/gh/apache/apisix-dashboard/pull/970?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   



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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




  1   2   3   >