Skip to content

break dependency on version cmd for non-cli pkgs#17335

Merged
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
juanvallejo:jvallejo/break-cmd-version-dependency-non-cli-pkgs
Nov 18, 2017
Merged

break dependency on version cmd for non-cli pkgs#17335
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
juanvallejo:jvallejo/break-cmd-version-dependency-non-cli-pkgs

Conversation

@juanvallejo
Copy link
Copy Markdown
Contributor

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

@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 15, 2017
@juanvallejo juanvallejo mentioned this pull request Nov 15, 2017
19 tasks
@juanvallejo juanvallejo force-pushed the jvallejo/break-cmd-version-dependency-non-cli-pkgs branch from 9319d84 to 3ef4a4b Compare November 15, 2017 23:25
Long: "Display client and server versions",
Run: func(cmd *cobra.Command, args []string) {
fmt.Fprintf(out, "%s %v\n", fullName, version.Get())
fmt.Fprintf(out, "kubernetes %v\n", kubeversion.Get())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These commands shouldn't be showing a kube or an etcd version


kubeversion "k8s.io/kubernetes/pkg/version"

"github.com/openshift/origin/pkg/version"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This dependency is incorrect as we start splitting these out of tree. Update it to take a version interface and force the caller to provide it. Take inspiration from the version endpoint in k8s.io/apiserver, but do not directly reference it.

@deads2k
Copy link
Copy Markdown
Contributor

deads2k commented Nov 16, 2017

@juanvallejo see how badly this conflict with #17115

@juanvallejo
Copy link
Copy Markdown
Contributor Author

juanvallejo commented Nov 16, 2017

@deads2k

see how badly this conflict with #17115

Added a new commit that receives a VersionInfo, forcing callers of pkg/cmd/version#NewCmdVersion to call it with a provider of version info.

Saw no conflict with rebase branch locally.

@juanvallejo juanvallejo force-pushed the jvallejo/break-cmd-version-dependency-non-cli-pkgs branch 2 times, most recently from 319ca13 to 739b21b Compare November 16, 2017 21:59
cmds.AddCommand(NewSchedulerCommand("scheduler", fullName+" scheduler", out))
if "hyperkube" == fullName {
cmds.AddCommand(cmd.NewCmdVersion(fullName, nil, out, cmd.VersionOptions{}))
cmds.AddCommand(cmdversion.NewCmdVersion(fullName, version.Get(), out))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not this one. This one is just wrong. It is a legitimate target for removal.

)

// VersionInfo provides semantic version information
// in a humnan-friendly format
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

typo

// VersionInfo provides semantic version information
// in a humnan-friendly format
type VersionInfo interface {
String() string
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

TODO, may be expanded for various short and formatting options if necessary.

// Use the openshift-specific version command
cmds.AddCommand(cmd.NewCmdVersion("kubefed", f, out, cmd.VersionOptions{PrintClientFeatures: true}))

cmds.AddCommand(versioncmd.NewCmdVersion("kubefed", version.Get(), out))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not this one for now either. It also looks wrong.

@deads2k
Copy link
Copy Markdown
Contributor

deads2k commented Nov 17, 2017

minor comments, then squash.

@juanvallejo for future reference, if I need separate commits for re-review, I'll specifically mention it in my review. I think sttts always prefers separate commits. Just a personal preference to keep things rolling smoothly.

@juanvallejo juanvallejo force-pushed the jvallejo/break-cmd-version-dependency-non-cli-pkgs branch from 739b21b to 79b3fbe Compare November 17, 2017 16:25
@juanvallejo
Copy link
Copy Markdown
Contributor Author

@deads2k thanks for the review, comments addressed, commits squashed

@0xmichalis 0xmichalis assigned deads2k and unassigned tiran and 0xmichalis Nov 17, 2017
@juanvallejo
Copy link
Copy Markdown
Contributor Author

/retest

@deads2k
Copy link
Copy Markdown
Contributor

deads2k commented Nov 17, 2017

/lgtm

See comment above about not conflicting with the rebase.

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 17, 2017
@openshift-merge-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, juanvallejo

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

Details 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

@openshift-merge-robot openshift-merge-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 17, 2017
@juanvallejo
Copy link
Copy Markdown
Contributor Author

/retest

@openshift-bot
Copy link
Copy Markdown
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot
Copy link
Copy Markdown
Contributor

Automatic merge from submit-queue.

@openshift-merge-robot openshift-merge-robot merged commit 8ffa313 into openshift:master Nov 18, 2017
@openshift-ci-robot
Copy link
Copy Markdown

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

Test name Commit Details Rerun command
ci/openshift-jenkins/extended_builds 79b3fbe link /test extended_builds
ci/openshift-jenkins/extended_conformance_install_update 79b3fbe link /test extended_conformance_install_update
ci/openshift-jenkins/extended_conformance_gce 79b3fbe 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.

Details

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.

@juanvallejo juanvallejo deleted the jvallejo/break-cmd-version-dependency-non-cli-pkgs branch November 20, 2017 16:00
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/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