From cb7809941842701049db7445dac569de26980a9e Mon Sep 17 00:00:00 2001 From: Rohan CJ Date: Wed, 6 Nov 2024 16:45:12 +0530 Subject: [PATCH] fix: rename loft->vcluster platform Signed-off-by: Rohan CJ --- cmd/vclusterctl/cmd/platform/destroy.go | 12 ++++++------ pkg/cli/start/docker.go | 2 +- pkg/cli/start/start.go | 6 +++--- pkg/platform/clihelper/clihelper.go | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cmd/vclusterctl/cmd/platform/destroy.go b/cmd/vclusterctl/cmd/platform/destroy.go index de49f3a30c..b1c8477fa8 100644 --- a/cmd/vclusterctl/cmd/platform/destroy.go +++ b/cmd/vclusterctl/cmd/platform/destroy.go @@ -30,12 +30,12 @@ func NewDestroyCmd(globalFlags *flags.GlobalFlags) *cobra.Command { destroyCmd := &cobra.Command{ Use: "destroy", - Short: "Destroy a vCluster platform instance", + Short: "Destroy a vCluster Platform instance", Long: `######################################################## -############# vcluster platform destroy ################## +############# vCluster Platform destroy ################## ######################################################## -Destroys a vCluster platform instance in your Kubernetes cluster. +Destroys a vCluster Platform instance in your Kubernetes cluster. Please make sure you meet the following requirements before running this command: @@ -55,7 +55,7 @@ VirtualClusterInstances managed with driver helm will be deleted, but the underl } destroyCmd.Flags().StringVar(&cmd.Context, "context", "", "The kube context to use for installation") - destroyCmd.Flags().StringVar(&cmd.Namespace, "namespace", "", "The namespace vCluster platform is installed in") + destroyCmd.Flags().StringVar(&cmd.Namespace, "namespace", "", "The namespace vCluster Platform is installed in") destroyCmd.Flags().BoolVar(&cmd.DeleteNamespace, "delete-namespace", true, "Whether to delete the namespace or not") destroyCmd.Flags().BoolVar(&cmd.IgnoreNotFound, "ignore-not-found", false, "Exit successfully if platform installation is not found") destroyCmd.Flags().BoolVar(&cmd.Force, "force", false, "Try uninstalling even if the platform is not installed. '--namespace' is required if true") @@ -78,7 +78,7 @@ func (cmd *DestroyCmd) Run(ctx context.Context) error { cmd.Log.Info("no platform installation found") return nil } - return fmt.Errorf("vCluster platform may not be installed: %w", err) + return fmt.Errorf("vCluster Platform may not be installed: %w", err) } cmd.Log.Infof("found platform installation in namespace %q", namespace) cmd.Namespace = namespace @@ -86,7 +86,7 @@ func (cmd *DestroyCmd) Run(ctx context.Context) error { found, err := clihelper.IsLoftAlreadyInstalled(ctx, cmd.KubeClient, cmd.Namespace) if err != nil { - return fmt.Errorf("vCluster platform may not be installed: %w", err) + return fmt.Errorf("vCluster Platform may not be installed: %w", err) } shouldForce := cmd.Force && cmd.Namespace != "" if !found && !shouldForce { diff --git a/pkg/cli/start/docker.go b/pkg/cli/start/docker.go index d533f313f0..f5e8afd457 100644 --- a/pkg/cli/start/docker.go +++ b/pkg/cli/start/docker.go @@ -215,7 +215,7 @@ func (l *LoftStarter) prepareDocker() error { // test for helm and kubectl _, err := exec.LookPath("docker") if err != nil { - return fmt.Errorf("seems like docker is not installed. Docker is required for the installation of loft. Please visit https://docs.docker.com/engine/install/ for install instructions") + return fmt.Errorf("seems like docker is not installed. Docker is required for the installation of vCluster Platform. Please visit https://docs.docker.com/engine/install/ for install instructions") } output, err := exec.Command("docker", "ps").CombinedOutput() diff --git a/pkg/cli/start/start.go b/pkg/cli/start/start.go index 0684d76091..799e588652 100644 --- a/pkg/cli/start/start.go +++ b/pkg/cli/start/start.go @@ -161,7 +161,7 @@ func (l *Options) Prepare() error { contextToLoad = l.Context } else if platformConfig.LastInstallContext != "" && platformConfig.LastInstallContext != contextToLoad { contextToLoad, err = l.Log.Question(&survey.QuestionOptions{ - Question: product.Replace(fmt.Sprintf("Seems like you try to use 'loft %s' with a different kubernetes context than before. Please choose which kubernetes context you want to use", l.CommandName)), + Question: product.Replace(fmt.Sprintf("Seems like you try to use 'vcluster %s' with a different kubernetes context than before. Please choose which kubernetes context you want to use", l.CommandName)), DefaultValue: contextToLoad, Options: []string{contextToLoad, platformConfig.LastInstallContext}, }) @@ -182,7 +182,7 @@ func (l *Options) Prepare() error { // test for helm and kubectl _, err = exec.LookPath("helm") if err != nil { - return fmt.Errorf("seems like helm is not installed. Helm is required for the installation of loft. Please visit https://helm.sh/docs/intro/install/ for install instructions") + return fmt.Errorf("seems like helm is not installed. Helm is required for the installation of vCluster Platform. Please visit https://helm.sh/docs/intro/install/ for install instructions") } output, err := exec.Command("helm", "version").CombinedOutput() @@ -192,7 +192,7 @@ func (l *Options) Prepare() error { _, err = exec.LookPath("kubectl") if err != nil { - return fmt.Errorf("seems like kubectl is not installed. Kubectl is required for the installation of loft. Please visit https://kubernetes.io/docs/tasks/tools/install-kubectl/ for install instructions") + return fmt.Errorf("seems like kubectl is not installed. Kubectl is required for the installation of vCluster Platform. Please visit https://kubernetes.io/docs/tasks/tools/install-kubectl/ for install instructions") } output, err = exec.Command("kubectl", "version", "--context", contextToLoad).CombinedOutput() diff --git a/pkg/platform/clihelper/clihelper.go b/pkg/platform/clihelper/clihelper.go index 36a38230b8..222b844de1 100644 --- a/pkg/platform/clihelper/clihelper.go +++ b/pkg/platform/clihelper/clihelper.go @@ -469,7 +469,7 @@ func IsLoftAlreadyInstalled(ctx context.Context, kubeClient kubernetes.Interface return true, nil } -var ErrPlatformNamespaceNotFound = errors.New("loft installation namespace not found") +var ErrPlatformNamespaceNotFound = errors.New("vCluster Platform installation namespace not found") func VClusterPlatformInstallationNamespace(ctx context.Context) (string, error) { kubeClientConfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(clientcmd.NewDefaultClientConfigLoadingRules(), &clientcmd.ConfigOverrides{})