Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AnalyzeCmd = &cobra.Command{ Use: "analyze", Aliases: []string{"analyse"}, Short: "This command will find problems within your Kubernetes cluster", Long: `This command will find problems within your Kubernetes cluster and provide you with a list of issues that need to be resolved`, Run: func(cmd *cobra.Command, args []string) { config, err := analysis.NewAnalysis( backend, language, filters, namespace, nocache, explain, maxConcurrency, withDoc, interactiveMode, ) if err != nil { color.Red("Error: %v", err) os.Exit(1) } defer config.Close() if customAnalysis { config.RunCustomAnalysis() } config.RunAnalysis() if explain { if err := config.GetAIResults(output, anonymize); err != nil { color.Red("Error: %v", err) os.Exit(1) } } output_data, err := config.PrintOutput(output) if err != nil { color.Red("Error: %v", err) os.Exit(1) } fmt.Println(string(output_data)) if interactiveMode && explain { if output == "json" { color.Yellow("Caution: interactive mode using --json enabled may use additional tokens.") } sigs := make(chan os.Signal, 1) signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM) interactiveClient := interactive.NewInteractionRunner(config, output_data) go interactiveClient.StartInteraction() for { select { case res := <-sigs: switch res { default: os.Exit(0) } case res := <-interactiveClient.State: switch res { case interactive.E_EXITED: os.Exit(0) } } } } }, }
AnalyzeCmd represents the problems command
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.