You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/01/19 07:06:03 UTC
[GitHub] [apisix-dashboard] tokers opened a new pull request #1333: chore: add stop subcommand
tokers opened a new pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333
Please answer these questions before submitting a pull request
- Why submit this pull request?
- [ ] Bugfix
- [x] New feature provided
- [ ] Improve performance
- [ ] Backport patches
- Related issues
closing #741
___
### Bugfix
- Description
- How to fix?
___
### New feature or improvement
- Describe the details and related test reports.
___
### Please add the corresponding test cases if necessary.
___
### Backport patches
- Why need to backport?
- Source branch
- Related commits and pull requests
- Target branch
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix-dashboard] tokers commented on pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
tokers commented on pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#issuecomment-762646578
@starsz
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix-dashboard] membphis commented on pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
membphis commented on pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#issuecomment-764554100
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix-dashboard] idbeta edited a comment on pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
idbeta edited a comment on pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#issuecomment-766514278
> @membphis @idbeta Added.
LGTM
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix-dashboard] tokers commented on pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
tokers commented on pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#issuecomment-765050694
@membphis @idbeta Added.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix-dashboard] idbeta commented on pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
idbeta commented on pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#issuecomment-766514278
> @membphis @idbeta Added.
LGTM
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix-dashboard] tokers commented on a change in pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
tokers commented on a change in pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#discussion_r560616623
##########
File path: api/internal/utils/pid.go
##########
@@ -0,0 +1,53 @@
+/*
+ * 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.
+ */
+
+package utils
+
+import (
+ "fmt"
+ "io/ioutil"
+ "os"
+ "strconv"
+)
+
+// WritePID write pid to the given file path.
+func WritePID(filepath string) error {
Review comment:
If we can sure the pid path in the future will not change, we can do it of course.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix-dashboard] membphis commented on pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
membphis commented on pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#issuecomment-765109347
> @membphis @idbeta Added.
LGTM
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix-dashboard] tokers commented on a change in pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
tokers commented on a change in pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#discussion_r560870942
##########
File path: api/cmd/managerapi.go
##########
@@ -119,5 +132,28 @@ func NewManagerAPICommand() *cobra.Command {
}
cmd.PersistentFlags().StringVarP(&conf.WorkDir, "work-dir", "p", ".", "current work directory")
+
+ cmd.AddCommand(newStopCommand())
+ return cmd
+}
+
+func newStopCommand() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "stop",
+ Run: func(cmd *cobra.Command, args []string) {
+ pid, err := utils.ReadPID(conf.PIDPath)
+ if err != nil {
+ if syscall.ENOENT.Error() == err.Error() {
+ fmt.Fprintf(os.Stderr, "failed to get manager-api pid: %s\n", err)
+ } else {
+ fmt.Fprintf(os.Stderr, "pid path %s not found, is manager-api running?\n", conf.PIDPath)
+ }
Review comment:
Yes.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix-dashboard] juzhiyuan commented on pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#issuecomment-766527954
ping @tokers
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix-dashboard] starsz merged pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
starsz merged pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix-dashboard] juzhiyuan commented on pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#issuecomment-766513381
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#issuecomment-763274597
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=h1) Report
> Merging [#1333](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=desc) (35cb72e) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/8852e630f0c2890d6607ab56925f3c0aaf6144d8?el=desc) (8852e63) will **decrease** coverage by `0.28%`.
> The diff coverage is `0.00%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1333 +/- ##
==========================================
- Coverage 44.31% 44.02% -0.29%
==========================================
Files 32 33 +1
Lines 1961 1976 +15
==========================================
+ Hits 869 870 +1
- Misses 981 995 +14
Partials 111 111
```
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/pid.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1333/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL3BpZC5nbw==) | `0.00% <0.00%> (ø)` | |
| [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1333/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `81.01% <0.00%> (+0.63%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=footer). Last update [8852e63...35cb72e](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=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:
users@infra.apache.org
[GitHub] [apisix-dashboard] idbeta commented on pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
idbeta commented on pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#issuecomment-766514278
> @membphis @idbeta Added.
LGTM
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix-dashboard] tokers commented on pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
tokers commented on pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#issuecomment-763265319
> @tokers , thank you for this. Just FYI, the file `api/manager` is in this PR. 😄
Oh my gosh, i'll remove it, sorry~
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#discussion_r559966953
##########
File path: api/internal/utils/pid.go
##########
@@ -0,0 +1,53 @@
+/*
+ * 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.
+ */
+
+package utils
+
+import (
+ "fmt"
+ "io/ioutil"
+ "os"
+ "strconv"
+)
+
+// WritePID write pid to the given file path.
+func WritePID(filepath string) error {
Review comment:
could we get the file path in the function since the function name is specified `WritePID` ?
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix-dashboard] tokers commented on a change in pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
tokers commented on a change in pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#discussion_r560873158
##########
File path: api/cmd/managerapi.go
##########
@@ -119,5 +132,28 @@ func NewManagerAPICommand() *cobra.Command {
}
cmd.PersistentFlags().StringVarP(&conf.WorkDir, "work-dir", "p", ".", "current work directory")
+
+ cmd.AddCommand(newStopCommand())
+ return cmd
+}
+
+func newStopCommand() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "stop",
+ Run: func(cmd *cobra.Command, args []string) {
+ pid, err := utils.ReadPID(conf.PIDPath)
+ if err != nil {
+ if syscall.ENOENT.Error() == err.Error() {
+ fmt.Fprintf(os.Stderr, "failed to get manager-api pid: %s\n", err)
+ } else {
+ fmt.Fprintf(os.Stderr, "pid path %s not found, is manager-api running?\n", conf.PIDPath)
+ }
Review comment:
Fixed.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix-dashboard] tokers commented on pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
tokers commented on pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#issuecomment-764630383
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#issuecomment-763274597
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=h1) Report
> Merging [#1333](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=desc) (62c2a57) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/749eeb58651c03b1d387d81a1d6f636f7fee93ae?el=desc) (749eeb5) will **increase** coverage by `17.42%`.
> The diff coverage is `20.00%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1333 +/- ##
===========================================
+ Coverage 44.36% 61.79% +17.42%
===========================================
Files 31 42 +11
Lines 1961 2387 +426
===========================================
+ Hits 870 1475 +605
+ Misses 979 734 -245
- Partials 112 178 +66
```
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/internal/conf/conf.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1333/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvbmYvY29uZi5nbw==) | `67.85% <ø> (ø)` | |
| [api/cmd/managerapi.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1333/diff?src=pr&el=tree#diff-YXBpL2NtZC9tYW5hZ2VyYXBpLmdv) | `54.41% <15.00%> (ø)` | |
| [api/internal/utils/pid.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1333/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL3BpZC5nbw==) | `26.66% <26.66%> (ø)` | |
| [api/internal/core/storage/etcd.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1333/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmFnZS9ldGNkLmdv) | `42.69% <0.00%> (ø)` | |
| [...l/handler/route\_online\_debug/route\_online\_debug.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1333/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvcm91dGVfb25saW5lX2RlYnVnL3JvdXRlX29ubGluZV9kZWJ1Zy5nbw==) | `73.80% <0.00%> (ø)` | |
| [api/internal/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1333/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3JvdXRlLmdv) | `83.87% <0.00%> (ø)` | |
| [api/internal/log/log.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1333/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2xvZy9sb2cuZ28=) | `50.00% <0.00%> (ø)` | |
| [api/internal/handler/healthz/healthz.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1333/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvaGVhbHRoei9oZWFsdGh6Lmdv) | `66.66% <0.00%> (ø)` | |
| ... and [27 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1333/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=footer). Last update [749eeb5...62c2a57](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=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:
users@infra.apache.org
[GitHub] [apisix-dashboard] tokers commented on pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
tokers commented on pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#issuecomment-764630383
Ok, will add it as soon as Possible.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix-dashboard] juzhiyuan commented on pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#issuecomment-766513381
ping @starsz @imjoey
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io commented on pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#issuecomment-763274597
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=h1) Report
> Merging [#1333](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=desc) (62c2a57) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/749eeb58651c03b1d387d81a1d6f636f7fee93ae?el=desc) (749eeb5) will **decrease** coverage by `0.38%`.
> The diff coverage is `0.00%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1333 +/- ##
==========================================
- Coverage 44.36% 43.98% -0.39%
==========================================
Files 31 33 +2
Lines 1961 1978 +17
==========================================
Hits 870 870
- Misses 979 996 +17
Partials 112 112
```
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/pid.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1333/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL3BpZC5nbw==) | `0.00% <0.00%> (ø)` | |
| [api/cmd/manager/main.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1333/diff?src=pr&el=tree#diff-YXBpL2NtZC9tYW5hZ2VyL21haW4uZ28=) | `0.00% <0.00%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=footer). Last update [749eeb5...62c2a57](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=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:
users@infra.apache.org
[GitHub] [apisix-dashboard] idbeta commented on pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
idbeta commented on pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#issuecomment-763436044
You should add instructions in the document.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix-dashboard] nic-chen commented on pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
nic-chen commented on pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#issuecomment-762661299
> @tokers , thank you for this. Just FYI, the file `api/manager` is in this PR. 😄
yes, we should not submit the binary
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#issuecomment-763274597
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=h1) Report
> Merging [#1333](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=desc) (35cb72e) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/8852e630f0c2890d6607ab56925f3c0aaf6144d8?el=desc) (8852e63) will **decrease** coverage by `0.28%`.
> The diff coverage is `0.00%`.
[](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #1333 +/- ##
==========================================
- Coverage 44.31% 44.02% -0.29%
==========================================
Files 32 33 +1
Lines 1961 1976 +15
==========================================
+ Hits 869 870 +1
- Misses 981 995 +14
Partials 111 111
```
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [api/internal/utils/pid.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1333/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL3BpZC5nbw==) | `0.00% <0.00%> (ø)` | |
| [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1333/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `81.01% <0.00%> (+0.63%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=footer). Last update [8852e63...35cb72e](https://codecov.io/gh/apache/apisix-dashboard/pull/1333?src=pr&el=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:
users@infra.apache.org
[GitHub] [apisix-dashboard] imjoey commented on pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
imjoey commented on pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#issuecomment-762649134
@tokers , thank you for this. Just FYI, the file `api/manager` is in 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:
users@infra.apache.org
[GitHub] [apisix-dashboard] starsz commented on a change in pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
starsz commented on a change in pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#discussion_r560693660
##########
File path: api/cmd/managerapi.go
##########
@@ -119,5 +132,28 @@ func NewManagerAPICommand() *cobra.Command {
}
cmd.PersistentFlags().StringVarP(&conf.WorkDir, "work-dir", "p", ".", "current work directory")
+
+ cmd.AddCommand(newStopCommand())
+ return cmd
+}
+
+func newStopCommand() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "stop",
+ Run: func(cmd *cobra.Command, args []string) {
+ pid, err := utils.ReadPID(conf.PIDPath)
+ if err != nil {
+ if syscall.ENOENT.Error() == err.Error() {
+ fmt.Fprintf(os.Stderr, "failed to get manager-api pid: %s\n", err)
+ } else {
+ fmt.Fprintf(os.Stderr, "pid path %s not found, is manager-api running?\n", conf.PIDPath)
+ }
Review comment:
I think we should log the error info here.
`syscall.ENOENT.Error() == err.Error()` ?
Maybe `syscall.ENOENT.Error() != err.Error()`
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix-dashboard] idbeta edited a comment on pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
idbeta edited a comment on pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#issuecomment-766514278
> @membphis @idbeta Added.
LGTM
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix-dashboard] membphis commented on pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
membphis commented on pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333#issuecomment-764554100
ping @tokers
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix-dashboard] starsz merged pull request #1333: chore: add stop subcommand
Posted by GitBox <gi...@apache.org>.
starsz merged pull request #1333:
URL: https://github.com/apache/apisix-dashboard/pull/1333
----------------------------------------------------------------
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:
users@infra.apache.org