break dependency on version cmd for non-cli pkgs#17335
Conversation
9319d84 to
3ef4a4b
Compare
pkg/cmd/version/version.go
Outdated
| 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()) |
There was a problem hiding this comment.
These commands shouldn't be showing a kube or an etcd version
pkg/cmd/version/version.go
Outdated
|
|
||
| kubeversion "k8s.io/kubernetes/pkg/version" | ||
|
|
||
| "github.com/openshift/origin/pkg/version" |
There was a problem hiding this comment.
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.
|
@juanvallejo see how badly this conflict with #17115 |
319ca13 to
739b21b
Compare
| 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)) |
There was a problem hiding this comment.
Not this one. This one is just wrong. It is a legitimate target for removal.
pkg/cmd/version/version.go
Outdated
| ) | ||
|
|
||
| // VersionInfo provides semantic version information | ||
| // in a humnan-friendly format |
| // VersionInfo provides semantic version information | ||
| // in a humnan-friendly format | ||
| type VersionInfo interface { | ||
| String() string |
There was a problem hiding this comment.
TODO, may be expanded for various short and formatting options if necessary.
pkg/federation/kubefed/kubefed.go
Outdated
| // 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)) |
There was a problem hiding this comment.
not this one for now either. It also looks wrong.
|
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. |
739b21b to
79b3fbe
Compare
|
@deads2k thanks for the review, comments addressed, commits squashed |
|
/retest |
|
/lgtm See comment above about not conflicting with the rebase. |
|
[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. DetailsNeeds approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
|
/retest |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
Automatic merge from submit-queue. |
|
@juanvallejo: The following tests failed, say
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. DetailsInstructions 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. |
This patch solves a few of the items (currently checked) from #17309
Removes dependency on
pkg/cli/cmd/versionfor packages outsideof the
pkg/ocsubtree.cc @deads2k @liggitt @openshift/cli-review