mirror of
https://github.com/alibaba/higress.git
synced 2026-04-25 05:57:26 +08:00
feat: store profile to configmap or home dir and merge profiles to select when upgrade and uninstall (#649)
This commit is contained in:
@@ -17,6 +17,7 @@ package hgctl
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/alibaba/higress/pkg/cmd/hgctl/helm"
|
||||
@@ -134,7 +135,7 @@ func install(writer io.Writer, iArgs *InstallArgs) error {
|
||||
return fmt.Errorf("generate config: %v", err)
|
||||
}
|
||||
|
||||
fmt.Fprintf(writer, "🧐 Validating Profile: \"%s\" \n", profileName)
|
||||
fmt.Fprintf(writer, "\n🧐 Validating Profile: \"%s\" \n", profileName)
|
||||
err = profile.Validate()
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -144,6 +145,12 @@ func install(writer io.Writer, iArgs *InstallArgs) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to install manifests: %v", err)
|
||||
}
|
||||
|
||||
// Remove "~/.hgctl/profiles/install.yaml"
|
||||
if oldProfileName, isExisted := installer.GetInstalledYamlPath(); isExisted {
|
||||
_ = os.Remove(oldProfileName)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user