From 3e6639c30fe40964bc78a33a823309b36e19a220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xo=C3=A1n=20Mall=C3=B3n?= Date: Tue, 4 Jun 2024 18:34:28 +0200 Subject: [PATCH] chore: rename buildName flag to name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Xoán Mallón --- pkg/cmd/create/root.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/cmd/create/root.go b/pkg/cmd/create/root.go index 6408050c..93da66d2 100644 --- a/pkg/cmd/create/root.go +++ b/pkg/cmd/create/root.go @@ -20,7 +20,7 @@ import ( var ( // Flags recreateCluster bool - buildName string + name string kubeVersion string extraPortsMapping string kindConfigPath string @@ -45,7 +45,7 @@ var CreateCmd = &cobra.Command{ func init() { // cluster related flags CreateCmd.PersistentFlags().BoolVar(&recreateCluster, "recreate", false, "Delete cluster first if it already exists.") - CreateCmd.PersistentFlags().StringVar(&buildName, "build-name", "localdev", "Name for build (Prefix for kind cluster name, pod names, etc).") + CreateCmd.PersistentFlags().StringVar(&name, "name", "localdev", "Name for build (Prefix for kind cluster name, pod names, etc).") CreateCmd.PersistentFlags().StringVar(&kubeVersion, "kube-version", "v1.29.2", "Version of the kind kubernetes cluster to create.") CreateCmd.PersistentFlags().StringVar(&extraPortsMapping, "extra-ports", "", "List of extra ports to expose on the docker container and kubernetes cluster as nodePort (e.g. \"22:32222,9090:39090,etc\").") CreateCmd.PersistentFlags().StringVar(&kindConfigPath, "kind-config", "", "Path of the kind config file to be used instead of the default.") @@ -110,7 +110,7 @@ func create(cmd *cobra.Command, args []string) error { } opts := build.NewBuildOptions{ - Name: buildName, + Name: name, KubeVersion: kubeVersion, KubeConfigPath: kubeConfigPath, KindConfigPath: kindConfigPath, @@ -155,8 +155,8 @@ func create(cmd *cobra.Command, args []string) error { } func validate() error { - if buildName == "" { - return fmt.Errorf("must specify build-name") + if name == "" { + return fmt.Errorf("must specify name") } _, err := url.Parse(fmt.Sprintf("%s://%s:%s", protocol, host, port))