From fa4221ccf5b10468015c4f594cc61c981a82e344 Mon Sep 17 00:00:00 2001 From: Amruta Kale Date: Thu, 9 Jan 2025 17:19:50 +0530 Subject: [PATCH] fix(vclusterctl): deprecate kubernetes-version flag in vcluster create --- pkg/cli/create_helm.go | 5 +---- pkg/cli/flags/create/create.go | 2 ++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/cli/create_helm.go b/pkg/cli/create_helm.go index a6d6f51e15..65e1d4451a 100644 --- a/pkg/cli/create_helm.go +++ b/pkg/cli/create_helm.go @@ -263,6 +263,7 @@ func CreateHelm(ctx context.Context, options *CreateOptions, globalFlags *flags. if err != nil { return err } + chartValues, err := config.GetExtraValues(chartOptions) if err != nil { return err @@ -724,10 +725,6 @@ func (cmd *createHelm) getKubernetesVersion() (*version.Info, error) { majorMinorVer := semver.MajorMinor(cmd.KubernetesVersion) - if splittedVersion := strings.Split(cmd.KubernetesVersion, "."); len(splittedVersion) > 2 { - cmd.log.Warnf("currently we only support major.minor version (%s) and not the patch version (%s)", majorMinorVer, cmd.KubernetesVersion) - } - parsedVersion, err := config.ParseKubernetesVersionInfo(majorMinorVer) if err != nil { return nil, err diff --git a/pkg/cli/flags/create/create.go b/pkg/cli/flags/create/create.go index 2babb56a9c..1d243a56c0 100644 --- a/pkg/cli/flags/create/create.go +++ b/pkg/cli/flags/create/create.go @@ -29,6 +29,8 @@ func AddCommonFlags(cmd *cobra.Command, options *cli.CreateOptions) { _ = cmd.Flags().MarkDeprecated("distro", fmt.Sprintf("please specify the distro by setting %q accordingly via values.yaml file.", "controlPlane.distro")) _ = cmd.Flags().MarkHidden("update-current") _ = cmd.Flags().MarkDeprecated("update-current", fmt.Sprintf("please use %q.", "--connect")) + _ = cmd.Flags().MarkHidden("kubernetes-version") + _ = cmd.Flags().MarkDeprecated("kubernetes-version", fmt.Sprintf("please specify the kubernetes version by setting %q accordingly via values.yaml file.", "controlPlane.distro.k8s.version")) } func AddHelmFlags(cmd *cobra.Command, options *cli.CreateOptions) {