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

Move client/unversioned/remotecommand to client-go #41331

Merged
merged 5 commits into from
May 15, 2017

Conversation

dshulyak
Copy link
Contributor

@dshulyak dshulyak commented Feb 13, 2017

Module remotecommand originally part of kubernetes/pkg/client/unversioned was moved
to client-go/tools, and will be used as authoritative in kubectl, e2e and other places.

Module remotecommand relies on util/exec module which was copied to client-go/pkg/util

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 13, 2017
@k8s-github-robot k8s-github-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. release-note-label-needed labels Feb 13, 2017
@k8s-reviewable
Copy link

This change is Reviewable

@dshulyak
Copy link
Contributor Author

@caesarxuchao Can you take a look please?

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 13, 2017
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 14, 2017
@dshulyak
Copy link
Contributor Author

@caesarxuchao Hello, can you tell me when you will have time to take a look at this PR? I have some weird results, for example apimachinery is removed from _vendor, and i am not able to figure out whether i should add it back manually or not..

staging/copy.sh Outdated
@@ -125,6 +127,7 @@ rm -rf "${CLIENT_REPO_TEMP}"/vendor/k8s.io/kubernetes
# client-go will share the vendor of the main repo for now. When client-go
# becomes a standalone repo, it will have its own vendor
mv "${CLIENT_REPO_TEMP}"/vendor "${CLIENT_REPO_TEMP}"/_vendor
rm -r "${CLIENT_REPO_TEMP}"/_vendor/github.com/docker/docker/project/
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need to manually remove this folder?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this folder containers symlink that references file that is not copied

@@ -0,0 +1,18 @@
/*
Copy link
Member

Choose a reason for hiding this comment

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

Why does kubeadm get imported?

@@ -0,0 +1,17 @@
/*
Copy link
Member

Choose a reason for hiding this comment

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

Looks like remotecommand imports federation types as well, can we remove the dependency on federation and kubeadm types?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, looks like i can

@@ -0,0 +1,25 @@
/*
Copy link
Member

Choose a reason for hiding this comment

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

We are trying to remove the packages in /pkg/kubelet, which are are duplicate packages between kuberentes and client-go. Are there other users of pkg/kubelet/qos except for client-go? If so, we can move this package to client-go, and remove the original copy. cc @deads2k @sttts

@deads2k
Copy link
Contributor

deads2k commented Feb 14, 2017

No more copies. If this needs to move, we aren't going to make a copy of it. The authoritative (and only) copy should be in staging/client-go.

@caesarxuchao
Copy link
Member

@dshulyak i think it's correct that apimachinery is removed from vendor/. deads2k ran copy.sh once yesterday. You can rebase your PR so that you'll see less changes.

@sttts
Copy link
Contributor

sttts commented Feb 14, 2017

Why is remotecommand needed in client-go? Everything we move there we effectively declare to be a public, stable API (at least within minor versions, but still). Hence, what is the use-case?

Moreover, kubelet/server/remotecommand and pkg/util/term with those tons of dependencies move too?

IMO we need better separation, i.e. a number of dependencies cut before moving it.

@dshulyak
Copy link
Contributor Author

@sttts I am using exec in several k8s related projects to run different tests. I think there is definitely demand for such thing in client kubernetes/client-go#45

I can check what can be done to cut those dependencies before moving it

@sttts
Copy link
Contributor

sttts commented Feb 14, 2017

@dshulyak please try to cut those terminal related dependencies and of course the kubelet dep.

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 15, 2017
@@ -0,0 +1,53 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

pkg/util is an odd location for this. It's actually part of the API. As we don't have a better location for this, moving it to client-go would be fine IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the same for pkg/util/exec, i can't find good place for it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

perhaps pkg/util/remotecommand should be in apimachinery, i see similar comment for port forwarding from @deads2k

@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 15, 2017
@dshulyak
Copy link
Contributor Author

@k8s-bot verify test this

@dshulyak
Copy link
Contributor Author

dshulyak commented Feb 15, 2017

@sttts @deads2k @caesarxuchao I think this change now in good shape. Please review it when you will have time.

I need to move pkg/util/remotecommand/constants.go to apimachinery (the same as portforward/constants.go) and unify it with kubelet. I will do it in another change. Also I am not sure what is the proper place for pkg/util/exec, so I just placed it in client-go repo

@dshulyak
Copy link
Contributor Author

@k8s-bot test this

@dshulyak
Copy link
Contributor Author

I moved part of this PR into separate one, for easier review, #41543. Will rebase afterwards

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 21, 2017
@caesarxuchao
Copy link
Member

Sorry I have been ignoring the PR. I'm taking another look now.

@caesarxuchao
Copy link
Member

I left a few comments in #41543. Let's get that merged first.

@caesarxuchao
Copy link
Member

/release-note-none

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note-label-needed labels May 10, 2017
@caesarxuchao
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 10, 2017
@caesarxuchao
Copy link
Member

Thanks @dshulyak !

// ExitError is an interface that presents an API similar to os.ProcessState, which is
// what ExitError from os/exec is. This is designed to make testing a bit easier and
// probably loses some of the cross-platform properties of the underlying library.
type ExitError interface {
Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately this package is copied. We can remove the original copy in the kubernetes repo, that could be another PR.

Copy link
Member

Choose a reason for hiding this comment

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

@dshulyak let me know if you are up for a follow-up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@caesarxuchao i copied only parts that were used in remotecommand, do you think it makes sense to move the whole pkg/util/exec? if so, i can do it ofcourse

Copy link
Member

Choose a reason for hiding this comment

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

I see. Can we move ExitError to the remotecmd package? (removing the copy in client-go/util/exec/exec.go and in kubernetes/util/exec/exec.go). In a followup PR is fine. There are not many references to ExitError:

$ git grep -l "CodeExitError" | grep -v pkg/util/exec
pkg/client/unversioned/remotecommand/v4.go
pkg/kubectl/cmd/run.go
pkg/kubectl/cmd/util/helpers_test.go
pkg/kubelet/remote/remote_runtime.go
test/e2e/framework/util.go

Copy link
Member

Choose a reason for hiding this comment

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

@dshulyak please let me know if you are interested to do the follow up

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@caesarxuchao sure, i will do it

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, please assign me to the PR when it's out.

@lavalamp
Copy link
Member

/approve

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 12, 2017
@caesarxuchao
Copy link
Member

@k8s-bot unit test this

@caesarxuchao
Copy link
Member

@k8s-bot gce etcd3 e2e test this

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 13, 2017
Module remotecommand originally part of kubernetes/pkg/client/unversioned was moved
to client-go/tools, and will be used as authoritative in kubectl, e2e and other places.

Module remotecommand relies on util/exec module which will be copied to client-go/pkg/util
client-go/pkt/util was removed in favor of client-go util, which consists
only from CodeExitError and ExitError interface
@k8s-github-robot k8s-github-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels May 15, 2017
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented May 15, 2017

@dshulyak: The following test(s) failed:

Test name Commit Details Rerun command
Jenkins Cross Build 1d8cec20d79311546f819bb0248d7b24806282fe link @k8s-bot cross build this

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@caesarxuchao
Copy link
Member

@k8s-bot kops aws e2e test this

@caesarxuchao
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 15, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: caesarxuchao, dshulyak, lavalamp

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 41331, 45591, 45600, 45176, 45658)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants