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

start breaking deps on pkg/oc #17309

Conversation

juanvallejo
Copy link
Contributor

@juanvallejo juanvallejo commented Nov 14, 2017

Begin breaking dependencies on the pkg/oc subtree from the rest of the codebase.
https://docs.google.com/document/d/1mS-KRkU8zjCleBNi3WWhLtkH10hb8h4ajpFM743jnqg

This PR only serves to track affected files and their respective PRs.
The following is a list of files whose dependency on pkg/oc packages needs to be broken:

bold = only depend on pkg/oc for the NewCmdVersion logic - will make simple version helper outside of pkg/oc to resolve

cc @liggitt @deads2k @mfojtik @bparees

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 14, 2017
@openshift-merge-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: juanvallejo
We suggest the following additional approver: smarterclayton

Assign the PR to them by writing /assign @smarterclayton in a comment when ready.

The full list of commands accepted by this bot can be found here.

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

@deads2k
Copy link
Contributor

deads2k commented Nov 14, 2017

@juanvallejo can you dig into this one: pkg/cmd/infra/builder/builder.go ? I'm betting its a function for going from kubeconfig file to clientConfig. the image-registry hit a similar problem

@juanvallejo
Copy link
Contributor Author

@deads2k sure, will look into it now

@juanvallejo
Copy link
Contributor Author

juanvallejo commented Nov 14, 2017

@deads2k The dependency is only on NewCmdVersion. pkg/cmd/infra/builder/builder.go defines command entry points for:

$ openshift-sti-build
$ openshift-docker-build
$ openshift-git-clone
$ openshift-manage-dockerfile
$ openshift-extract-image-content

The same is true for pkg/cmd/infra/router/f5.go, pkg/cmd/infra/deployer/deployer.go, pkg/cmd/infra/router/template.go. and pkg/cmd/server/start/kubernetes/kubernetes.go

$ openshift-f5-router
$ openshift-deploy
$ openshift-router

Any chance we could just make all of these subcommands under oc?
The alternative would be to move or duplicate the code under pkg/oc/cli/cmd/version.go, or to remove the version subcommand from the above.

@deads2k
Copy link
Contributor

deads2k commented Nov 14, 2017

pkg/generate/app/cmd/ says oc to me. Who uses it?

@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 14, 2017
@juanvallejo
Copy link
Contributor Author

juanvallejo commented Nov 14, 2017

@deads2k pkg/generate/app/cmd/describe.go was the only file under that subtree I found with a reference to pkg/oc - was using a time formatter in the pkg/oc/cli/describe/helpers.go. Addressed in a5e30bb

@deads2k
Copy link
Contributor

deads2k commented Nov 14, 2017

@deads2k pkg/generate/app/cmd/describe.go was the only file under that subtree I found with a reference to pkg/oc - was using a time formatter in the pkg/oc/cli/describe/helpers.go. Addressed in a5e30bb

@juanvallejo pkg/generate/app/cmd is only imported by packages under pkg/oc. Move it under pkg/oc

@juanvallejo
Copy link
Contributor Author

juanvallejo commented Nov 14, 2017

  • pkg/cmd/util/clientcmd/factory_object_mapping.go -> depends on the oc describe#DescriberFor method (this is the only time it is called in the entire pkg/cmd/util/clientcmd pkg)

    • @deads2k would it make sense to move pkg/oc/cli/describe/describer.go outside of pkg/oc? (the file itself has no references to any packages within the pkg/oc subtree)
  • pkg/cmd/util/clientcmd/factory_client_access.go -> depends on the oc describe#NewHumanReadablePrinter method AND pkg/oc/cli/config#NewOpenShiftClientConfigLoadingRules method

@juanvallejo
Copy link
Contributor Author

pkg/cmd/server/start/master_args.go depends on generated bootstrap bindata, which is under pkg/oc/bootstrap - not sure how we plan to address this

@juanvallejo
Copy link
Contributor Author

juanvallejo commented Nov 14, 2017

pkg/cmd/server/admin/overwrite_bootstrappolicy.go depends on the cli describer. Apparently it defines the oc adm overwrite-policy command, but seems to live under pkg/cmd/server since it deals with authorization storage. Can this be moved under pkg/oc/admin?

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 14, 2017
@juanvallejo juanvallejo force-pushed the jvallejo/break-outside-deps-on-oc-subtree branch from 4b9c4d9 to 7c5030a Compare November 15, 2017 18:33
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 15, 2017
@sosiouxme
Copy link
Member

@juanvallejo what would it mean to "move some of the diagnostic commands under pkg/oc"? I don't think there's a reason to have oc adm diagnostics command definitions live outside pkg/oc/admin.

openshift-merge-robot added a commit that referenced this pull request Nov 18, 2017
…-dependency-non-cli-pkgs

Automatic merge from submit-queue.

break dependency on version cmd for non-cli pkgs

This patch solves a few of the items (currently checked) from #17309 
Removes dependency on `pkg/cli/cmd/version` for packages outside
of the `pkg/oc` subtree.

cc @deads2k @liggitt @openshift/cli-review
@juanvallejo juanvallejo changed the title [WIP] start breaking deps on pkg/oc start breaking deps on pkg/oc Nov 20, 2017
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 20, 2017
@juanvallejo juanvallejo force-pushed the jvallejo/break-outside-deps-on-oc-subtree branch from 7c5030a to c295644 Compare November 20, 2017 21:38
@openshift-ci-robot
Copy link

@juanvallejo: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/openshift-jenkins/extended_clusterup c295644 link /test extended_clusterup
ci/openshift-jenkins/extended_conformance_install c295644 link /test extended_conformance_install
ci/openshift-jenkins/extended_builds c295644 link /test extended_builds
ci/openshift-jenkins/extended_conformance_gce c295644 link /test extended_conformance_gce

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.

openshift-merge-robot added a commit that referenced this pull request Nov 21, 2017
…strap-policy

Automatic merge from submit-queue.

Remove overwrite_bootstrappolicy and pkg/cmd/server/admin/legacyetcd

Fixes #15817

This patch solves a few of the items (currently checked) from #17309
Removes the file `pkg/cmd/server/admin/overwrite_bootstrappolicy.go`
which has been deprecated (and had some dependencies on `pkg/oc`.
It also removes the deprecated package `pkg/cmd/server/admin/legacyetcd`.

cc @deads2k @liggitt @openshift/cli-review
@juanvallejo
Copy link
Contributor Author

@deads2k only dependency left to address is pkg/cmd/openshift/openshift.go which brings in nine packages from pkg/oc

openshift-merge-robot added a commit that referenced this pull request Nov 27, 2017
…pkg-oc

Automatic merge from submit-queue.

move pkg/diagnostices -> pkg/oc/admin/diagnostics

This patch is a part of pull/17356 - it aims to break all dependencies
between packages outside of pkg/oc and the clientcmd package.

This patch also partially solves a few of the items (currently checked) from #17309.
By moving `pkg/diagnostics` to the `pkg/oc` subtree, we are eliminating package
dependencies on `pkg/oc/...` in packages outside of that subtree.

cc @liggitt @deads2k @openshift/cli-review @sosiouxme
openshift-merge-robot added a commit that referenced this pull request Nov 27, 2017
…o-pkg-oc

Automatic merge from submit-queue (batch tested with PRs 17417, 17332).

Begin moving pkgs w/ deps on pkg/oc

This patch solves a few of the items (currently checked) from #17309

cc @deads2k @openshift/cli-review @liggitt
@juanvallejo juanvallejo deleted the jvallejo/break-outside-deps-on-oc-subtree branch November 28, 2017 17:28
openshift-merge-robot added a commit that referenced this pull request Nov 29, 2017
…g-oc

Automatic merge from submit-queue.

move pkg/cmd/util/clientcmd -> pkg/oc/cli/util/clientcmd

This patch *partially* solves a few of the items (currently checked) from #17309 
Now that `clientcmd` (which includes printer factory methods) is moved into `pkg/oc`,
the following files outside of `pkg/oc` need to have their dependency on `clientcmd` broken (this will be done in a separate PR):

- [x] pkg/cmd/server/origin/controller/config.go (#17357)
- [x] pkg/cmd/server/admin/create_error_template.go   (#17357)
- [x] pkg/cmd/server/admin/create_bootstrap_project_template.go (#17357)
- [x] pkg/cmd/server/admin/overwrite_bootstrappolicy.go (*this file has been removed by* #17336)
- [x] pkg/cmd/server/admin/create_login_template.go (#17357)
- [x] pkg/cmd/server/admin/create_provider_selection_template.go (#17357)
- [x] **pkg/cmd/infra/router/template.go** (Wanted by: `pkg/cmd/openshift/openshift.go` (no other dependents)) (#17357)
- [x] **pkg/cmd/infra/router/f5.go** (Wanted by: `pkg/cmd/openshift/openshift.go` (no other dependents)) (#17357)
- [x] pkg/cmd/openshift/openshift.go (#17486 and #17482)
- [x] pkg/cmd/dockerregistry/dockerregistry.go (Wanted by: `cmd/dockerregistry/main.go` (depends on `clientcmd.Config`)) (#17357)
- [x] *pkg/diagnostics/networkpod/util/util.go* (Can  be addressed by moving `pkg/diagnostics` inside existing `pkg/oc/admin/diagnostics`) #17393
- [x] *pkg/diagnostics/client/config_contexts.go* (Can  be addressed by moving `pkg/diagnostics` inside existing `pkg/oc/admin/diagnostics`) #17393
- [x] *pkg/diagnostics/client/run_diagnostics_pod.go* (Can  be addressed by moving `pkg/diagnostics` inside existing `pkg/oc/admin/diagnostics`) #17393
- [x] *pkg/diagnostics/pod/auth.go* (Can  be addressed by moving `pkg/diagnostics` inside existing `pkg/oc/admin/diagnostics`) #17393
- [x] *pkg/diagnostics/network/run_pod.go* (Can be addressed by moving `pkg/diagnostics` inside existing `pkg/oc/admin/diagnostics`) #17393
- [x] pkg/ipfailover/keepalived/plugin.go (moved to `pkg/oc/experimental`) (#17357)
- [x] pkg/federation/kubefed/kubefed.go (#17357)
- [x] pkg/dockerregistry/server/client/client.go (#17357)
- [x] pkg/dockerregistry/server/auth_test.go (#17357)

**bold** = depends on `clientcmd.Config` (not sure what to do about this) AND only dependent is `pkg/cmd/openshift/openshift.go`

cc @deads2k @openshift/cli-review @liggitt
csrwng pushed a commit to csrwng/origin that referenced this pull request Nov 30, 2017
…cmds-to-pkg-oc

Automatic merge from submit-queue.

move "openshift ex" -> "oc ex"

Moves the experimental command group to `oc` in order to break deps on `pkg/oc` in packages outside of that subtree. Part of openshift#17309 and openshift#17356

Release-Note: `Experimental commands moved from the "openshift" parent to the "oc" parent`

cc @deads2k @liggitt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants