mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2025-08-19 08:17:04 +00:00
Merge pull request #260 from hdm23061993/feat/issue-256
feat: check for auth only in case of --explain
This commit is contained in:
commit
7551f8bf03
@ -41,11 +41,6 @@ var AnalyzeCmd = &cobra.Command{
|
|||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(configAI.Providers) == 0 {
|
|
||||||
color.Red("Error: AI provider not specified in configuration. Please run k8sgpt auth")
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
var aiProvider ai.AIProvider
|
var aiProvider ai.AIProvider
|
||||||
for _, provider := range configAI.Providers {
|
for _, provider := range configAI.Providers {
|
||||||
if backend == provider.Name {
|
if backend == provider.Name {
|
||||||
@ -94,6 +89,11 @@ var AnalyzeCmd = &cobra.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if explain {
|
if explain {
|
||||||
|
if len(configAI.Providers) == 0 {
|
||||||
|
color.Red("Error: AI provider not specified in configuration. Please run k8sgpt auth")
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
err := config.GetAIResults(output, anonymize)
|
err := config.GetAIResults(output, anonymize)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
color.Red("Error: %v", err)
|
color.Red("Error: %v", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user