2016-11-05 17:09:05 -07:00
|
|
|
/*
|
|
|
|
|
Copyright 2016 The Rook Authors. All rights reserved.
|
|
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
|
limitations under the License.
|
|
|
|
|
*/
|
2016-09-29 17:09:21 -07:00
|
|
|
package main
|
2016-08-10 09:57:29 -07:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"fmt"
|
|
|
|
|
|
2018-05-18 14:32:20 -07:00
|
|
|
"github.com/rook/rook/cmd/rook/ceph"
|
|
|
|
|
rook "github.com/rook/rook/cmd/rook/rook"
|
2023-04-10 13:31:38 -06:00
|
|
|
"github.com/rook/rook/cmd/rook/userfacing"
|
2019-06-06 03:49:57 -06:00
|
|
|
"github.com/rook/rook/cmd/rook/util"
|
2018-05-18 14:32:20 -07:00
|
|
|
"github.com/rook/rook/cmd/rook/version"
|
2024-02-26 12:28:57 +00:00
|
|
|
_ "go.uber.org/automaxprocs"
|
2017-08-23 22:20:14 -07:00
|
|
|
)
|
|
|
|
|
|
2016-08-10 09:57:29 -07:00
|
|
|
func main() {
|
2016-09-29 16:49:00 -07:00
|
|
|
addCommands()
|
2018-05-18 14:32:20 -07:00
|
|
|
if err := rook.RootCmd.Execute(); err != nil {
|
2017-06-25 10:19:59 -07:00
|
|
|
fmt.Printf("rook error: %+v\n", err)
|
2016-08-10 09:57:29 -07:00
|
|
|
}
|
|
|
|
|
}
|
2016-09-29 16:49:00 -07:00
|
|
|
|
|
|
|
|
func addCommands() {
|
2019-02-21 23:35:23 +05:30
|
|
|
rook.RootCmd.AddCommand(
|
|
|
|
|
version.VersionCmd,
|
|
|
|
|
discoverCmd,
|
2021-09-16 15:24:29 +02:00
|
|
|
KeyManagementCmd,
|
2019-06-06 03:49:57 -06:00
|
|
|
// backend commands
|
2019-02-21 23:35:23 +05:30
|
|
|
ceph.Cmd,
|
2019-06-06 03:49:57 -06:00
|
|
|
|
|
|
|
|
// util commands
|
|
|
|
|
util.CmdReporterCmd,
|
2021-09-16 15:24:29 +02:00
|
|
|
)
|
2023-04-10 13:31:38 -06:00
|
|
|
// do double diligence to ensure non-user-facing commands are hidden from end users
|
|
|
|
|
for _, cmd := range rook.RootCmd.Commands() {
|
|
|
|
|
cmd.Hidden = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// all user-facing commands
|
|
|
|
|
rook.RootCmd.AddCommand(userfacing.Commands...)
|
2017-10-31 17:00:04 -07:00
|
|
|
}
|