From 1549f02a5f587e2cb6485698c1240e15ec4da5f2 Mon Sep 17 00:00:00 2001 From: Xudong Guo Date: Mon, 3 Jul 2023 15:00:53 +0800 Subject: [PATCH] chore: add note for add cloud aws (#723) --- cmd/cloud_add.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cmd/cloud_add.go b/cmd/cloud_add.go index f2f254c1..02abe634 100644 --- a/cmd/cloud_add.go +++ b/cmd/cloud_add.go @@ -4,6 +4,8 @@ import ( "errors" "fmt" + "github.com/mgutz/ansi" + "github.com/spf13/cobra" "github.com/sunny0826/kubecm/pkg/cloud" "k8s.io/client-go/tools/clientcmd" @@ -215,7 +217,13 @@ func (ca *CloudAddCommand) runCloudAdd(cmd *cobra.Command, args []string) error if err != nil { return err } - return AddToLocal(newConfig, fmt.Sprintf("aws-%s", clusterID), "", cover) + err = AddToLocal(newConfig, fmt.Sprintf("aws-%s", clusterID), "", cover) + if err != nil { + return err + } + fmt.Printf("%s: %s\n", + ansi.Color("Note", "blue"), + ansi.Color(" please install the AWS CLI before normal use.", "white+h")) } return nil } @@ -240,6 +248,7 @@ export RANCHER_SERVER_URL=https://xxx export RANCHER_API_KEY=YOUR_API_KEY # Set env AWS secret key +# Note: Please install the AWS CLI before normal use. export AWS_ACCESS_KEY_ID=YOUR_AKID export AWS_SECRET_ACCESS_KEY=YOUR_SECRET_KEY