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: pouch copy in client and daemon side #2182

Closed
wants to merge 1 commit into from

Conversation

knightXun
Copy link
Contributor

Ⅰ. Describe what this PR did

  1. copy file from container
  2. copy file to container

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@knightXun knightXun changed the title [WIP] pouch copy [WIP] [feature] pouch copy Aug 31, 2018
@@ -0,0 +1,30 @@
package types
Copy link
Collaborator

Choose a reason for hiding this comment

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

We do not manually edit this file, but generate it by swagger, you could see the reference: https://github.com/alibaba/pouch/blob/master/apis/README.md

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

cli/cp.go Outdated
"strings"
"path/filepath"

"github.com/spf13/cobra"
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should improve the import sequence by https://github.com/alibaba/pouch/blob/master/docs/contributions/code_styles.md#rule003---import-packages
And please keep this in mind in imports of all this pull request.

// We need to rebase the archive entries if the last element of the
// resolved path was a symlink that was evaluated and is now different
// than the requested path. For example, if the given path was "/foo/bar/",
// but it resolved to "/var/lib/docker/containers/{id}/foo/baz/", we want
Copy link
Collaborator

Choose a reason for hiding this comment

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

I do not think the details here are proper.

@@ -19,6 +19,9 @@ import (
"github.com/gorilla/mux"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"encoding/base64"
Copy link
Collaborator

Choose a reason for hiding this comment

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

import sequence.

return getContainerPathStatFromHeader(response.Header)
}

func ensureReaderClosed(response *Response) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This function is redudant with https://github.com/alibaba/pouch/blob/master/client/utils.go#L18.
Maybe we can re-use that.

@@ -5,6 +5,7 @@ import (
"strings"
)


Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove this blank line.

@allencloud allencloud changed the title [WIP] [feature] pouch copy [WIP] feature: and pouch copy in client and daemon side Aug 31, 2018
@allencloud
Copy link
Collaborator

I only add some initial comment. For this valuable part, I think we need to spend more time and patience to make this move on. @knightXun
We will definitely help to make it work. Let us carry on. Thanks a lot.

@allencloud
Copy link
Collaborator

Any update on this? @knightXun

@knightXun knightXun force-pushed the pouch-ls branch 8 times, most recently from 2bfa6b1 to fa32481 Compare September 7, 2018 03:02
@codecov-io
Copy link

codecov-io commented Sep 7, 2018

Codecov Report

Merging #2182 into master will decrease coverage by 0.37%.
The diff coverage is 42.17%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2182      +/-   ##
==========================================
- Coverage    66.5%   66.12%   -0.38%     
==========================================
  Files         208      208              
  Lines       16755    16985     +230     
==========================================
+ Hits        11143    11232      +89     
- Misses       4282     4403     +121     
- Partials     1330     1350      +20
Flag Coverage Δ
#criv1alpha1test 32.35% <1.3%> (-0.38%) ⬇️
#criv1alpha2test 33.04% <1.3%> (-0.54%) ⬇️
#integrationtest 39.95% <42.17%> (+0.01%) ⬆️
#nodee2etest 33.09% <1.3%> (-0.59%) ⬇️
#unittest 23.5% <0%> (-0.36%) ⬇️
Impacted Files Coverage Δ
apis/server/router.go 92.1% <100%> (+0.15%) ⬆️
daemon/mgr/container.go 53.06% <27.95%> (-4.53%) ⬇️
apis/server/container_bridge.go 78.24% <71.05%> (-1.02%) ⬇️
daemon/mgr/container_state.go 85.24% <78.57%> (-1.99%) ⬇️
cri/ocicni/cni_manager.go 65% <0%> (-15%) ⬇️
ctrd/watch.go 78.78% <0%> (-4.55%) ⬇️
cri/v1alpha2/cri.go 71.24% <0%> (-0.64%) ⬇️
cri/v1alpha2/cri_wrapper.go 64.43% <0%> (ø) ⬆️
daemon/containerio/container_io.go 75.69% <0%> (+1.1%) ⬆️
... and 3 more

@knightXun
Copy link
Contributor Author

now working on e2e test

@knightXun knightXun force-pushed the pouch-ls branch 4 times, most recently from a726b1b to b1fe729 Compare September 10, 2018 08:12
@knightXun knightXun changed the title [WIP] feature: and pouch copy in client and daemon side feature: and pouch copy in client and daemon side Sep 10, 2018
@knightXun
Copy link
Contributor Author

ping @allencloud

@allencloud
Copy link
Collaborator

I am afraid that we need to add more details in swagger.yml to define the API side. For adding new APIs, we should add definition in swagger.yml, like https://github.com/alibaba/pouch/blob/master/apis/README.md .

So please help to add that as well. I think we are almost there. Keep going. Thanks a lot. @knightXun

@knightXun
Copy link
Contributor Author

I will split this pr into 4 or 5 parts.

@pouchrobot
Copy link
Collaborator

ping @knightXun
Conflict happens after merging a previous commit.
Please rebase the branch against master and push it back again. Thanks a lot.

@fuweid
Copy link
Contributor

fuweid commented Jan 28, 2019

thanks @knightXun . And I close it and looking forward to the new PR :)

@fuweid fuweid closed this Jan 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

7 participants