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

break dep on clientcmd in pkgs outside pkg oc #17357

Conversation

juanvallejo
Copy link
Contributor

@juanvallejo juanvallejo commented Nov 16, 2017

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

To achieve this, this patch creates a new package containing only the
functions and objects found in clientcmd that are needed by its
dependents outside of the pkg/oc subtree. Once this is done, all of
the remaining logic (which should only be used by packages within
pkg/oc is moved to pkg/oc/cli/util/clientcmd by pull/17356).

This change acknowledges the possibility of having dependents for
pkg/cmd/util/clientconfig within the pkg/oc subtree.

cc @deads2k @openshift/cli-review @liggitt

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 16, 2017
@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 16, 2017
@@ -0,0 +1,24 @@
package clientconfig
Copy link
Contributor

Choose a reason for hiding this comment

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

not in pkg/cmd I think that should die soon. pkg/client/cmd perhaps.

@@ -27,7 +27,7 @@ func getOpenShiftClientEnvVars(options configapi.MasterConfig) ([]kapi.EnvVar, e
if err != nil {
return nil, err
}
return clientcmd.EnvVars(
return clientconfig.EnvVars(
Copy link
Contributor

Choose a reason for hiding this comment

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

This appears to be the only caller. Move it locally.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually the entire getOpenShiftClientEnvVars needs refactoring. Queue up an issue to tidy it 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.

Opened issue to track this: #17397

@juanvallejo juanvallejo force-pushed the jvallejo/break-dep-on-clientcmd-in-pkgs-outside-pkg-oc branch from 2085686 to b848907 Compare November 17, 2017 16:19
@0xmichalis 0xmichalis assigned deads2k and unassigned mfojtik and 0xmichalis Nov 17, 2017
@juanvallejo juanvallejo force-pushed the jvallejo/break-dep-on-clientcmd-in-pkgs-outside-pkg-oc branch 2 times, most recently from dbb7ad0 to 27984fe Compare November 17, 2017 19:45
@openshift-ci-robot openshift-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 17, 2017
@juanvallejo juanvallejo force-pushed the jvallejo/break-dep-on-clientcmd-in-pkgs-outside-pkg-oc branch from a9efe89 to 9d92673 Compare November 17, 2017 22:26
@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 19, 2017
@juanvallejo juanvallejo force-pushed the jvallejo/break-dep-on-clientcmd-in-pkgs-outside-pkg-oc branch from 9d92673 to d832b50 Compare November 20, 2017 16:22
@juanvallejo juanvallejo changed the title [WIP] break dep on clientcmd in pkgs outside pkg oc break dep on clientcmd in pkgs outside 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
@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 20, 2017
@juanvallejo juanvallejo force-pushed the jvallejo/break-dep-on-clientcmd-in-pkgs-outside-pkg-oc branch from d832b50 to f9a11f3 Compare November 20, 2017 17:00
@juanvallejo
Copy link
Contributor Author

/retest

// currentMigrationRules returns a map that holds the history of recommended home directories used in previous versions.
// Any future changes to RecommendedHomeFile and related are expected to add a migration rule here, in order to make
// sure existing config files are migrated to their new locations properly.
func CurrentMigrationRules() map[string]string {
Copy link
Contributor

Choose a reason for hiding this comment

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

do the commands using this care about migration rules? Which ones are they?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Our wrapper command for NewCmdConfig calls cmdconfig.NewOpenShiftClientConfigLoadingRules, which in turn calls currentMigrationRules

@juanvallejo juanvallejo mentioned this pull request Nov 20, 2017
19 tasks
@juanvallejo juanvallejo force-pushed the jvallejo/break-dep-on-clientcmd-in-pkgs-outside-pkg-oc branch 2 times, most recently from 07f93e4 to 3dda8b9 Compare November 27, 2017 16:45
@juanvallejo
Copy link
Contributor Author

/test extended_clusterup

@juanvallejo
Copy link
Contributor Author

cc @deads2k

@juanvallejo
Copy link
Contributor Author

@deads2k this won't build until #17486 merges and I rebase

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

To achieve this, this patch creates a new package containing only the
functions and objects found in `clientcmd` that are needed by its
dependents outside of the `pkg/oc` subtree. Once this is done, all of
the remaining logic (which should only be used by packages within
`pkg/oc` is moved to `pkg/oc/cli/util/clientcmd` by pull/17356).

This change acknowledges the possibility of having dependents for
`pkg/cmd/util/clientconfig` within the `pkg/oc` subtree.
@juanvallejo juanvallejo force-pushed the jvallejo/break-dep-on-clientcmd-in-pkgs-outside-pkg-oc branch from 4900fe4 to 213f9a8 Compare November 30, 2017 17:20
@juanvallejo
Copy link
Contributor Author

/test extended_clusterup

@deads2k
Copy link
Contributor

deads2k commented Nov 30, 2017

/retest

@deads2k deads2k added the lgtm Indicates that a PR is ready to be merged. label Nov 30, 2017
@deads2k
Copy link
Contributor

deads2k commented Nov 30, 2017

/retest

@juanvallejo
Copy link
Contributor Author

/test extended_clusterup

@juanvallejo
Copy link
Contributor Author

/retest

@juanvallejo
Copy link
Contributor Author

/test crio

@juanvallejo
Copy link
Contributor Author

/retest

@deads2k
Copy link
Contributor

deads2k commented Nov 30, 2017

@juanvallejo start writing up flake issues for the different e2e issues.

@juanvallejo
Copy link
Contributor Author

extended_clusterup flaked on #17548

@juanvallejo
Copy link
Contributor Author

crio test flaked on #14898 - error talking to yum

@juanvallejo
Copy link
Contributor Author

/retest

@juanvallejo
Copy link
Contributor Author

/test extended_conformance_install

@juanvallejo
Copy link
Contributor Author

/retest

2 similar comments
@juanvallejo
Copy link
Contributor Author

/retest

@deads2k
Copy link
Contributor

deads2k commented Dec 1, 2017

/retest

@openshift-merge-robot
Copy link
Contributor

/test all [submit-queue is verifying that this PR is safe to merge]

@openshift-ci-robot
Copy link

openshift-ci-robot commented Dec 1, 2017

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

Test name Commit Details Rerun command
ci/openshift-jenkins/extended_conformance_install_update 213f9a8 link /test extended_conformance_install_update

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
Copy link
Contributor

Automatic merge from submit-queue.

@openshift-merge-robot openshift-merge-robot merged commit 4d2f14d into openshift:master Dec 1, 2017
@juanvallejo juanvallejo deleted the jvallejo/break-dep-on-clientcmd-in-pkgs-outside-pkg-oc branch December 1, 2017 15:03
openshift-merge-robot added a commit that referenced this pull request Dec 5, 2017
Automatic merge from submit-queue (batch tested with PRs 17536, 17512).

 prevent references from origin to oc

Builds on #17516 and #17357

After this, oc can be deleted from origin during the next kube bump.

@juanvallejo missed one.  I hacked it in.  You'll want to pretty it up eventually.
@eparis @smarterclayton after this merges, I think we're good to branch 3.8.
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. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants