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

'operator-sdk print-deps' command #772

Merged
merged 6 commits into from
Nov 26, 2018
Merged

Conversation

estroz
Copy link
Member

@estroz estroz commented Nov 21, 2018

Description of the change: add an operator-sdk print-deps sub-command to print the most recent operator dependencies and versions. The sub-command will print pretty (below) by default, or the full Gopkg.toml when passed the --as-file flag.

Motivation for the change: updating operator versions when upgrading to new binary versions requires looking at SDK source code. This command prints all version information for packages pre-defined by the SDK that can be copy and pasted into an operators' Gopkg.toml, or written over directly with the --as-file flag.

Sample of output:

NAME						VERSION		BRANCH		REVISION
github.com/operator-framework/operator-sdk			master
k8s.io/code-generator								6702109cc68eb6fe6350b83e14407c8d7309fd1a
k8s.io/api									2d6f90ab1293a1fb871cf149423ebb72aa7423aa
k8s.io/apiextensions-apiserver							408db4a50408e2149acbd657bceb2480c13cb0a4
k8s.io/apimachinery								103fd098999dc9c0c88536f5c9ad2e5da39373ae
k8s.io/client-go								1f13a808da65775f22cbf47862c4e5898d8f4ca1
sigs.k8s.io/controller-runtime			v0.1.4

required = [
 "k8s.io/code-generator/cmd/defaulter-gen",
 "k8s.io/code-generator/cmd/deepcopy-gen",
 "k8s.io/code-generator/cmd/conversion-gen",
 "k8s.io/code-generator/cmd/client-gen",
 "k8s.io/code-generator/cmd/lister-gen",
 "k8s.io/code-generator/cmd/informer-gen",
 "k8s.io/code-generator/cmd/openapi-gen",
 "k8s.io/gengo/args"
]

Closes #638

@estroz estroz added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 21, 2018
@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/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 21, 2018
@estroz estroz changed the title [WIP] 'operator-sdk print-deps' command 'operator-sdk print-deps' command Nov 21, 2018
@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 21, 2018
func NewPrintDepsCmd() *cobra.Command {
printDepsCmd := &cobra.Command{
Use: "print-deps",
Short: "Print dependencies expected by the Operator SDK",
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Think this could be phrased a bit differently to avoid confusion, dependencies can also mean, the things we expect like requirements we depend on: e.g. dep itself, version of go, etc. WDYT?

Copy link
Member Author

@estroz estroz Nov 26, 2018

Choose a reason for hiding this comment

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

"Print Golang packages and versions required to run the operator"?

@estroz estroz merged commit 84ab8b4 into operator-framework:master Nov 26, 2018
@estroz estroz deleted the feat-638 branch November 26, 2018 20:32
@hasbro17
Copy link
Contributor

@estroz Can you follow this up by updating the CHANGELOG for the new cmd.

### Flags

* `--as-file` Print packages and versions in Gopkg.toml format.

Copy link
Contributor

Choose a reason for hiding this comment

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

@estroz Sorry for the late review but it might be good to have a truncated example output here for a particular version, as we do for other commands.
We can show the --as-file output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. 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.

None yet

6 participants