From af53a58b8ef2d4e0236989fcbe1132d7343a7833 Mon Sep 17 00:00:00 2001 From: qiaozp <47812250+chivalryq@users.noreply.github.com> Date: Tue, 26 Apr 2022 15:27:43 +0800 Subject: [PATCH] Fix: velaux addon hint after enable (#3747) * Fix: velaux addon hint after enable Signed-off-by: qiaozp * check if upgrade Signed-off-by: qiaozp --- references/cli/addon.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/references/cli/addon.go b/references/cli/addon.go index 4016282cf..74cc7aa6d 100644 --- a/references/cli/addon.go +++ b/references/cli/addon.go @@ -179,7 +179,7 @@ Enable addon for specific clusters, (local means control plane): } } fmt.Printf("Addon: %s enabled Successfully.\n", name) - AdditionalEndpointPrinter(ctx, c, k8sClient, name) + AdditionalEndpointPrinter(ctx, c, k8sClient, name, false) return nil }, } @@ -190,7 +190,7 @@ Enable addon for specific clusters, (local means control plane): } // AdditionalEndpointPrinter will print endpoints -func AdditionalEndpointPrinter(ctx context.Context, c common.Args, k8sClient client.Client, name string) { +func AdditionalEndpointPrinter(ctx context.Context, c common.Args, k8sClient client.Client, name string, isUpgrade bool) { fmt.Printf("Please access the %s from the following endpoints:\n", name) err := printAppEndpoints(ctx, k8sClient, pkgaddon.Convert2AppName(name), types.DefaultKubeVelaNS, Filter{}, c) if err != nil { @@ -198,11 +198,13 @@ func AdditionalEndpointPrinter(ctx context.Context, c common.Args, k8sClient cli return } if name == "velaux" { - fmt.Println(`To check the initialized admin user name and password by:`) - fmt.Println(` vela logs -n vela-system --name apiserver addon-velaux | grep "initialized admin username"`) + if !isUpgrade { + fmt.Println(`To check the initialized admin user name and password by:`) + fmt.Println(` vela logs -n vela-system --name apiserver addon-velaux | grep "initialized admin username"`) + } fmt.Println(`To open the dashboard directly by port-forward:`) fmt.Println(` vela port-forward -n vela-system addon-velaux 9082:80`) - fmt.Println(`Select "Cluster: local | Namespace: vela-system | Component: velaux | Kind: Service" from the prompt.`) + fmt.Println(`Select "Cluster: local | Namespace: vela-system | Kind: Service | Name: velaux" from the prompt.`) fmt.Println(`Please refer to https://kubevela.io/docs/reference/addons/velaux for more VelaUX addon installation and visiting method.`) } } @@ -276,7 +278,7 @@ Upgrade addon for specific clusters, (local means control plane): } fmt.Printf("Addon: %s\n enabled Successfully.", name) - AdditionalEndpointPrinter(ctx, c, k8sClient, name) + AdditionalEndpointPrinter(ctx, c, k8sClient, name, true) return nil }, }