-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
roachprod: move command init out of main
This PR refactors roachprod to move the commands out from the main.go to a separate package. Along with the commands, the flags are also moved. Separating the sub commands to a separate package will help us in better code maintenance and easier integration of these commands with other flows like drtprod. Also, initialisation outside of main can help us in making the commands unit testable. Not that, with this PR, there is no change in functionality of roachprod. The code will be further enhance for maintainability by separating the commands from commands.go into different categories (like cluster provisioning, datadog, prometheus) and make them separate go files. Epic: none Release note: None
- Loading branch information
1 parent
bea204f
commit 0aa7db1
Showing
13 changed files
with
2,860 additions
and
2,441 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library") | ||
|
||
go_library( | ||
name = "cli", | ||
srcs = [ | ||
"bash_completion.go", | ||
"commands.go", | ||
"flags.go", | ||
"handlers.go", | ||
"resgistry.go", | ||
"update.go", | ||
"util.go", | ||
], | ||
importpath = "github.com/cockroachdb/cockroach/pkg/cmd/roachprod/cli", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//pkg/cmd/roachprod/grafana", | ||
"//pkg/roachprod", | ||
"//pkg/roachprod/cloud", | ||
"//pkg/roachprod/config", | ||
"//pkg/roachprod/errors", | ||
"//pkg/roachprod/fluentbit", | ||
"//pkg/roachprod/install", | ||
"//pkg/roachprod/opentelemetry", | ||
"//pkg/roachprod/roachprodutil", | ||
"//pkg/roachprod/ssh", | ||
"//pkg/roachprod/ui", | ||
"//pkg/roachprod/vm", | ||
"//pkg/roachprod/vm/gce", | ||
"//pkg/util/envutil", | ||
"//pkg/util/flagutil", | ||
"//pkg/util/timeutil", | ||
"@com_github_cockroachdb_errors//:errors", | ||
"@com_github_cockroachdb_errors//oserror", | ||
"@com_github_fatih_color//:color", | ||
"@com_github_spf13_cobra//:cobra", | ||
"@com_google_cloud_go_storage//:storage", | ||
"@org_golang_google_api//option", | ||
"@org_golang_x_crypto//ssh", | ||
"@org_golang_x_exp//maps", | ||
"@org_golang_x_term//:term", | ||
"@org_golang_x_text//language", | ||
"@org_golang_x_text//message", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.