Merge pull request #2698 from darshanime/unhide_cobra

unhide cobra commands
This commit is contained in:
Travis Nielsen authored and GitHub committed 2019-02-22 14:11:12 -07:00
commit eea375ece7
16 files changed
+63 -92

No files matched your search

+3 -5
View File
@@ -27,9 +27,8 @@ import (
// Cmd exports cobra command according to the cobra documentation.
var Cmd = &cobra.Command{
Use: "cassandra",
Short: "Main command for cassandra controller pod.",
Hidden: true,
Use: "cassandra",
Short: "Main command for cassandra controller pod.",
}
var (
@@ -37,8 +36,7 @@ var (
)
func init() {
Cmd.AddCommand(operatorCmd)
Cmd.AddCommand(sidecarCmd)
Cmd.AddCommand(operatorCmd, sidecarCmd)
}
func createContext() *clusterd.Context {
+2 -3
View File
@@ -29,9 +29,8 @@ import (
)
var agentCmd = &cobra.Command{
Use: "agent",
Short: "Runs the rook ceph agent",
Hidden: true,
Use: "agent",
Short: "Runs the rook ceph agent",
}
func init() {
+9 -14
View File
@@ -30,9 +30,8 @@ import (
// Cmd is the main command for operator and daemons.
var Cmd = &cobra.Command{
Use: "ceph",
Short: "Main command for Ceph operator and daemons.",
Hidden: true,
Use: "ceph",
Short: "Main command for Ceph operator and daemons.",
}
var (
@@ -56,17 +55,13 @@ type config struct {
}
func init() {
AddCommands(Cmd)
}
func AddCommands(command *cobra.Command) {
command.AddCommand(operatorCmd)
command.AddCommand(agentCmd)
command.AddCommand(osdCmd)
command.AddCommand(rgwCmd)
command.AddCommand(mdsCmd)
command.AddCommand(configCmd)
command.AddCommand(nfsCmd)
Cmd.AddCommand(operatorCmd,
agentCmd,
osdCmd,
rgwCmd,
mdsCmd,
configCmd,
nfsCmd)
}
func createContext() *clusterd.Context {
+2 -3
View File
@@ -35,9 +35,8 @@ key = %s
)
var configCmd = &cobra.Command{
Use: "config-init",
Short: "Generates basic ceph config",
Hidden: true,
Use: "config-init",
Short: "Generates basic ceph config",
}
var (
+2 -3
View File
@@ -32,9 +32,8 @@ var (
)
var mdsCmd = &cobra.Command{
Use: mdsdaemon.InitCommand,
Short: "Generates mds config and runs the mds daemon",
Hidden: true,
Use: mdsdaemon.InitCommand,
Short: "Generates mds config and runs the mds daemon",
}
func init() {
+7 -11
View File
@@ -30,19 +30,16 @@ var (
)
var nfsCmd = &cobra.Command{
Use: "nfs",
Short: "Configures and runs the ceph nfs daemon",
Hidden: true,
Use: "nfs",
Short: "Configures and runs the ceph nfs daemon",
}
var ganeshaConfigCmd = &cobra.Command{
Use: "init",
Short: "Updates ceph.conf for nfs",
Hidden: true,
Use: "init",
Short: "Updates ceph.conf for nfs",
}
var ganeshaRunCmd = &cobra.Command{
Use: "run",
Short: "Runs the ceph nfs daemon",
Hidden: true,
Use: "run",
Short: "Runs the ceph nfs daemon",
}
func init() {
@@ -50,8 +47,7 @@ func init() {
ganeshaConfigCmd.Flags().StringVar(&ganeshaCopyBinariesPath, "copy-binaries-path", "", "If specified, copy the rook binaries to this path for use by the daemon container")
addCephFlags(ganeshaConfigCmd)
nfsCmd.AddCommand(ganeshaConfigCmd)
nfsCmd.AddCommand(ganeshaRunCmd)
nfsCmd.AddCommand(ganeshaConfigCmd, ganeshaRunCmd)
flags.SetFlagsFromEnv(nfsCmd.Flags(), rook.RookEnvVarPrefix)
flags.SetFlagsFromEnv(ganeshaConfigCmd.Flags(), rook.RookEnvVarPrefix)
+1 -2
View File
@@ -22,7 +22,7 @@ import (
"github.com/rook/rook/cmd/rook/rook"
"github.com/rook/rook/pkg/clusterd"
"github.com/rook/rook/pkg/daemon/ceph/agent/flexvolume/attachment"
"github.com/rook/rook/pkg/operator/ceph"
operator "github.com/rook/rook/pkg/operator/ceph"
"github.com/rook/rook/pkg/operator/ceph/cluster/mon"
"github.com/rook/rook/pkg/operator/ceph/csi"
"github.com/rook/rook/pkg/operator/k8sutil"
@@ -37,7 +37,6 @@ var operatorCmd = &cobra.Command{
Short: "Runs the Ceph operator for orchestrating and managing Ceph storage in a Kubernetes cluster",
Long: `Runs the Ceph operator for orchestrating and managing Ceph storage in a Kubernetes cluster
https://github.com/rook/rook`,
Hidden: true,
}
func init() {
+17 -23
View File
@@ -36,34 +36,28 @@ import (
)
var osdCmd = &cobra.Command{
Use: "osd",
Short: "Provisions and runs the osd daemon",
Hidden: true,
Use: "osd",
Short: "Provisions and runs the osd daemon",
}
var osdConfigCmd = &cobra.Command{
Use: "init",
Short: "Updates ceph.conf for the osd",
Hidden: true,
Use: "init",
Short: "Updates ceph.conf for the osd",
}
var copyBinariesCmd = &cobra.Command{
Use: "copybins",
Short: "Copies rook binaries for use by a ceph container",
Hidden: true,
Use: "copybins",
Short: "Copies rook binaries for use by a ceph container",
}
var provisionCmd = &cobra.Command{
Use: "provision",
Short: "Generates osd config and prepares an osd for runtime",
Hidden: true,
Use: "provision",
Short: "Generates osd config and prepares an osd for runtime",
}
var filestoreDeviceCmd = &cobra.Command{
Use: "filestore-device",
Short: "Runs the ceph daemon for a filestore device",
Hidden: true,
Use: "filestore-device",
Short: "Runs the ceph daemon for a filestore device",
}
var osdStartCmd = &cobra.Command{
Use: "start",
Short: "Starts the osd daemon", // OSDs that were provisioned by ceph-volume
Hidden: true,
Use: "start",
Short: "Starts the osd daemon", // OSDs that were provisioned by ceph-volume
}
var (
osdDataDeviceFilter string
@@ -107,11 +101,11 @@ func addOSDFlags(command *cobra.Command) {
osdStartCmd.Flags().StringVar(&osdStoreType, "osd-store-type", "", "whether the osd is bluestore or filestore")
// add the subcommands to the parent osd command
osdCmd.AddCommand(osdConfigCmd)
osdCmd.AddCommand(copyBinariesCmd)
osdCmd.AddCommand(provisionCmd)
osdCmd.AddCommand(filestoreDeviceCmd)
osdCmd.AddCommand(osdStartCmd)
osdCmd.AddCommand(osdConfigCmd,
copyBinariesCmd,
provisionCmd,
filestoreDeviceCmd,
osdStartCmd)
}
func addOSDConfigFlags(command *cobra.Command) {
+2 -3
View File
@@ -28,9 +28,8 @@ import (
)
var rgwCmd = &cobra.Command{
Use: "rgw",
Short: "Generates rgw config and runs the rgw daemon",
Hidden: true,
Use: "rgw",
Short: "Generates rgw config and runs the rgw daemon",
}
var (
+1 -1
View File
@@ -28,7 +28,7 @@ import (
var Cmd = &cobra.Command{
Use: "cockroachdb",
Short: "Main command for cockroachdb operator and daemons.",
Hidden: true,
Hidden: false,
}
var (
+2 -3
View File
@@ -30,9 +30,8 @@ import (
var (
discoverCmd = &cobra.Command{
Use: "discover",
Short: "Discover devices",
Hidden: true,
Use: "discover",
Short: "Discover devices",
}
// interval between discovering devices
+1 -1
View File
@@ -28,7 +28,7 @@ import (
var Cmd = &cobra.Command{
Use: "edgefs",
Short: "Main command for edgefs operator and daemons.",
Hidden: true,
Hidden: false,
}
var (
+9 -12
View File
@@ -36,16 +36,13 @@ func main() {
}
func addCommands() {
rook.RootCmd.AddCommand(version.VersionCmd)
rook.RootCmd.AddCommand(discoverCmd)
rook.RootCmd.AddCommand(ceph.Cmd)
rook.RootCmd.AddCommand(cockroachdb.Cmd)
rook.RootCmd.AddCommand(minio.Cmd)
rook.RootCmd.AddCommand(edgefs.Cmd)
rook.RootCmd.AddCommand(nfs.Cmd)
rook.RootCmd.AddCommand(cassandra.Cmd)
// add the ceph legacy commands to the main command for backwards compatibility
// TODO: remove these Ceph legacy commands in the future
ceph.AddCommands(rook.RootCmd)
rook.RootCmd.AddCommand(
version.VersionCmd,
discoverCmd,
ceph.Cmd,
cockroachdb.Cmd,
minio.Cmd,
edgefs.Cmd,
nfs.Cmd,
cassandra.Cmd)
}
+2 -3
View File
@@ -26,9 +26,8 @@ import (
)
var Cmd = &cobra.Command{
Use: "minio",
Short: "Main command for Minio operator and daemons.",
Hidden: true,
Use: "minio",
Short: "Main command for Minio operator and daemons.",
}
var (
+2 -3
View File
@@ -26,9 +26,8 @@ import (
)
var Cmd = &cobra.Command{
Use: "nfs",
Short: "Main command for NFS operator and daemons.",
Hidden: true,
Use: "nfs",
Short: "Main command for NFS operator and daemons.",
}
var (
+1 -2
View File
@@ -39,8 +39,7 @@ const (
)
var RootCmd = &cobra.Command{
Use: "rook",
Hidden: true,
Use: "rook",
}
var (