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

feature: add resize interface #879

Merged

Conversation

HusterWan
Copy link
Contributor

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

Ⅰ. Describe what this PR did

add a resize interface for pouch

Ⅱ. Does this pull request fix one issue?

fixes #866

Ⅲ. Describe how you did it

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@@ -2447,6 +2470,15 @@ definitions:
additionalProperties:
type: "string"

ResizeOptions:
Copy link
Collaborator

Choose a reason for hiding this comment

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

If this is only used in daemon side, I do not think we should list this in swagger.yml.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, this struct is used by both

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see. I found that you are not using this ResizeOptions to communicate between client side and daemon side. You indeed use ResizeOptions in package client, but when sending request, you split this struct into two separate parameters:

query.Set("h", strconv.Itoa(int(opts.Height)))
query.Set("w", strconv.Itoa(int(opts.Width)))

So in daemon side, you use both two parameters above to construct this struct ResizeOptions again.

I am afraid that the way is not the same as other struct used by both client and daemon side.

Correct me if I missed something, please.

@allencloud
Copy link
Collaborator

Since #881 has been merged, please rebase to the latest branch and push back again. Thanks. @HusterWan

@HusterWan HusterWan force-pushed the zr/add-resize-interface branch from 504dacd to f771d03 Compare March 13, 2018 00:52
@sunyuan3
Copy link
Contributor

ping @HusterWan
A error leads to the CI failure.
Step to reproduce:

git clone -b zr/add-resize-interface https://github.com/HusterWan/pouch.git
cd pouch
sudo make -e test

Log is as follow.

root@p0:/go/src/github.com/alibaba/pouch# docker run --rm -v /go/src/github.com/alibaba/pouch:/go/src/github.com/alibaba/pouch pouch:test bash -c 'make build'
GOOS=linux go build -o pouchd
# github.com/alibaba/pouch/daemon/mgr
daemon/mgr/container.go:498:9: cannot use mgr (type *ContainerManager) as type ContainerMgr in field value:
	*ContainerManager does not implement ContainerMgr (wrong type for Resize method)
		have Resize(string, "github.com/alibaba/pouch/apis/types".ResizeOptions) error
		want Resize("context".Context, string, "github.com/alibaba/pouch/apis/types".ResizeOptions) error
Makefile:23: recipe for target 'server' failed
make: *** [server] Error 2

@HusterWan
Copy link
Contributor Author

@sunyuan3 thanks a lot, i will fix soon

@HusterWan HusterWan force-pushed the zr/add-resize-interface branch from f771d03 to af05c15 Compare March 13, 2018 01:36
@codecov-io
Copy link

codecov-io commented Mar 13, 2018

Codecov Report

Merging #879 into master will decrease coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #879      +/-   ##
==========================================
- Coverage      14%   13.98%   -0.02%     
==========================================
  Files         119      119              
  Lines        7477     7486       +9     
==========================================
  Hits         1047     1047              
- Misses       6341     6350       +9     
  Partials       89       89
Impacted Files Coverage Δ
client/container.go 0% <0%> (ø) ⬆️
daemon/mgr/container.go 2.68% <0%> (-0.01%) ⬇️

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 0dc6fa0...b9fb5eb. Read the comment docs.

apis/swagger.yml Outdated
responses:
200:
description: "no error"
404:
Copy link
Collaborator

Choose a reason for hiding this comment

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

You returned 400(StatusBadRequest), and I am afraid you should add this in your swagger.yml to keep consistent.

@allencloud
Copy link
Collaborator

LGTM

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Mar 16, 2018
@allencloud allencloud merged commit b97bd2b into AliyunContainerService:master Mar 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature LGTM one maintainer or community participant agrees to merge the pull reuqest. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature required] need API /containers/(id or name)/resize
5 participants