Add detecting higress installed by helm or not before install (#620)

This commit is contained in:
Jun
2023-11-02 15:41:01 +08:00
committed by GitHub
parent 344035698a
commit 7b1f538d38
8 changed files with 104 additions and 10 deletions

View File

@@ -35,6 +35,14 @@ type K8sInstaller struct {
}
func (o *K8sInstaller) Install() error {
// check if higress is installed by helm
fmt.Fprintf(o.writer, "\n⌛ Detecting higress installed by helm or not... \n\n")
helmAgent := NewHelmAgent(o.profile, o.writer, false)
if helmInstalled, _ := helmAgent.IsHigressInstalled(); helmInstalled {
fmt.Fprintf(o.writer, "\n🧐 You have already installed higress by helm, please use \"helm upgrade\" to upgrade higress!\n")
return nil
}
if _, err := GetProfileInstalledPath(); err != nil {
return err
}