Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: restful api url should support both with or without version info #1035

Merged

Conversation

HusterWan
Copy link
Contributor

Signed-off-by: Michael Wan [email protected]

Ⅰ. Describe what this PR did

Ⅱ. Does this pull request fix one issue?

i check the moby api, it also support with or without version info in restful api url

Now we support both without version info in restful api url:

wanziren@osboxes:pouch (zr/fix-api-version) -> sudo curl /var/run/pouchd.sock http://0.0.0.0:8080/info
curl: (3) <url> malformed
{"Containers":200,"ContainersRunning":200,"Debug":true,"DefaultRegistry":"registry.hub.docker.com","DefaultRuntime":"runc","DriverStatus":null,"IndexServerAddress":"https://index.docker.io/v1/","KernelVersion":"3.10.0-693.17.1.el7.x86_64","Labels":[],"ListenAddresses":["tcp://0.0.0.0:8080","unix:///var/run/pouchd.sock"],"OSType":"linux","PouchRootDir":"/var/lib/pouch","SecurityOptions":null,"ServerVersion":"0.4.0-dev"}

and with version info in restful api url:

wanziren@osboxes:pouch (zr/fix-api-version) -> sudo curl /var/run/pouchd.sock http://0.0.0.0:8080/v1.24/info
curl: (3) <url> malformed
{"Containers":200,"ContainersRunning":200,"Debug":true,"DefaultRegistry":"registry.hub.docker.com","DefaultRuntime":"runc","DriverStatus":null,"IndexServerAddress":"https://index.docker.io/v1/","KernelVersion":"3.10.0-693.17.1.el7.x86_64","Labels":[],"ListenAddresses":["tcp://0.0.0.0:8080","unix:///var/run/pouchd.sock"],"OSType":"linux","PouchRootDir":"/var/lib/pouch","SecurityOptions":null,"ServerVersion":"0.4.0-dev"}

Ⅲ. Describe how you did it

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@pouchrobot pouchrobot added kind/bug This is bug report for project size/XS labels Apr 2, 2018
@HusterWan HusterWan force-pushed the zr/fix-api-version branch from 0352085 to 4690a00 Compare April 2, 2018 12:38
@codecov-io
Copy link

Codecov Report

Merging #1035 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1035   +/-   ##
=======================================
  Coverage   15.18%   15.18%           
=======================================
  Files         135      135           
  Lines        8483     8483           
=======================================
  Hits         1288     1288           
  Misses       7094     7094           
  Partials      101      101

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 85d808d...4690a00. Read the comment docs.

@allencloud
Copy link
Collaborator

Please add an API integration test to cover this. @HusterWan 😄

@@ -55,5 +56,5 @@ func (suite *APIVersionSuite) TestNoVersionParamsInURL(c *check.C) {
resp, err := apiClient.HTTPCli.Do(req)
c.Assert(err, check.IsNil)

CheckRespStatus(c, resp, 404)
CheckRespStatus(c, resp, 201)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is already an API integration test for the target.

@allencloud
Copy link
Collaborator

LGTM

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Apr 3, 2018
@allencloud allencloud merged commit 46c67ec into AliyunContainerService:master Apr 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This is bug report for project LGTM one maintainer or community participant agrees to merge the pull reuqest. size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants