mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2025-09-02 15:55:35 +00:00
feat: don't ask for password if backend is localai
Signed-off-by: Aris Boutselis <aris.boutselis@senseon.io>
This commit is contained in:
@@ -71,7 +71,7 @@ var AuthCmd = &cobra.Command{
|
|||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if password == "" {
|
if ai.NeedPassword(backend) && password == "" {
|
||||||
fmt.Printf("Enter %s Key: ", backend)
|
fmt.Printf("Enter %s Key: ", backend)
|
||||||
bytePassword, err := term.ReadPassword(int(syscall.Stdin))
|
bytePassword, err := term.ReadPassword(int(syscall.Stdin))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@@ -67,3 +67,7 @@ func (p *AIProvider) GetPassword() string {
|
|||||||
func (p *AIProvider) GetModel() string {
|
func (p *AIProvider) GetModel() string {
|
||||||
return p.Model
|
return p.Model
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NeedPassword(backend string) bool {
|
||||||
|
return backend != "localai"
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user