From 58e0b7521616eab8420156bfc2736ddf5c112d86 Mon Sep 17 00:00:00 2001 From: Andrew Stucki Date: Mon, 16 Sep 2024 15:51:09 -0400 Subject: [PATCH] Fix up use of helmette.SafeLookup calls (redpanda-data/helm-charts#1526) Make RestToConfig work with file-system based rest.Config such as when using controller-runtime. --- pkg/kube/config.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/kube/config.go b/pkg/kube/config.go index 8b3304fa0..7c9d2aaee 100644 --- a/pkg/kube/config.go +++ b/pkg/kube/config.go @@ -19,6 +19,7 @@ func RestToConfig(cfg *rest.Config) clientcmdapi.Config { clusters := make(map[string]*clientcmdapi.Cluster) clusters["default-cluster"] = &clientcmdapi.Cluster{ Server: cfg.Host, + CertificateAuthority: cfg.CAFile, CertificateAuthorityData: cfg.CAData, } @@ -30,8 +31,12 @@ func RestToConfig(cfg *rest.Config) clientcmdapi.Config { authinfos := make(map[string]*clientcmdapi.AuthInfo) authinfos["default-user"] = &clientcmdapi.AuthInfo{ + Token: cfg.BearerToken, + TokenFile: cfg.BearerTokenFile, ClientCertificateData: cfg.CertData, + ClientCertificate: cfg.CertFile, ClientKeyData: cfg.KeyData, + ClientKey: cfg.KeyFile, } return clientcmdapi.Config{