mirror of
https://github.com/hanzo-ml/kuberay.git
synced 2026-10-30 19:48:47 +00:00
34 lines
954 B
Go
34 lines
954 B
Go
package cmd
|
|
|
|
import (
|
|
"k8s.io/cli-runtime/pkg/genericiooptions"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/ray-project/kuberay/kubectl-plugin/pkg/cmd/cluster"
|
|
"github.com/ray-project/kuberay/kubectl-plugin/pkg/cmd/job"
|
|
"github.com/ray-project/kuberay/kubectl-plugin/pkg/cmd/log"
|
|
"github.com/ray-project/kuberay/kubectl-plugin/pkg/cmd/session"
|
|
)
|
|
|
|
func NewRayCommand(streams genericiooptions.IOStreams) *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "ray",
|
|
Short: "ray kubectl plugin",
|
|
Long: "Manage RayCluster resources.",
|
|
SilenceUsage: true,
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
cmd.HelpFunc()(cmd, args)
|
|
},
|
|
CompletionOptions: cobra.CompletionOptions{
|
|
DisableDefaultCmd: true,
|
|
},
|
|
}
|
|
|
|
cmd.AddCommand(cluster.NewClusterCommand(streams))
|
|
cmd.AddCommand(session.NewSessionCommand(streams))
|
|
cmd.AddCommand(log.NewClusterLogCommand(streams))
|
|
cmd.AddCommand(job.NewJobCommand(streams))
|
|
return cmd
|
|
}
|