From b86e6d8500396e9d2795e19bf3861548a37b8f05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bojanowski?= Date: Thu, 19 Sep 2024 13:19:21 +0200 Subject: [PATCH] revert adding --ca-data flag to vcluster platform add cluster MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Bojanowski --- cmd/vclusterctl/cmd/platform/add/cluster.go | 26 ++++++++++----------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/cmd/vclusterctl/cmd/platform/add/cluster.go b/cmd/vclusterctl/cmd/platform/add/cluster.go index 4d4cd408f..9a9f4afc1 100644 --- a/cmd/vclusterctl/cmd/platform/add/cluster.go +++ b/cmd/vclusterctl/cmd/platform/add/cluster.go @@ -30,17 +30,16 @@ import ( type ClusterCmd struct { Log log.Logger *flags.GlobalFlags - Namespace string - ServiceAccount string - DisplayName string - Context string - Insecure bool - Wait bool - HelmChartPath string - HelmChartVersion string - HelmSet []string - HelmValues []string - CertificateAuthorityData []byte + Namespace string + ServiceAccount string + DisplayName string + Context string + Insecure bool + Wait bool + HelmChartPath string + HelmChartVersion string + HelmSet []string + HelmValues []string } // NewClusterCmd creates a new command @@ -81,7 +80,6 @@ vcluster platform add cluster my-cluster c.Flags().StringArrayVar(&cmd.HelmSet, "helm-set", []string{}, "Extra helm values for the agent chart") c.Flags().StringArrayVar(&cmd.HelmValues, "helm-values", []string{}, "Extra helm values for the agent chart") c.Flags().StringVar(&cmd.Context, "context", "", "The kube context to use for installation") - c.Flags().BytesBase64Var(&cmd.CertificateAuthorityData, "ca-data", []byte{}, "additional, base64 encoded certificate authority data that will be passed to the platform secret") return c } @@ -204,8 +202,8 @@ func (cmd *ClusterCmd) Run(ctx context.Context, args []string) error { helmArgs = append(helmArgs, "--set", "insecureSkipVerify=true") } - if len(cmd.CertificateAuthorityData) > 0 { - helmArgs = append(helmArgs, "--set", "additionalCA="+string(cmd.CertificateAuthorityData)) + if accessKey.CaCert != "" { + helmArgs = append(helmArgs, "--set", "additionalCA="+accessKey.CaCert) } if cmd.Wait {