Skip to content

Commit

Permalink
Fix up use of helmette.SafeLookup calls (redpanda-data/helm-charts#1526)
Browse files Browse the repository at this point in the history
Make RestToConfig work with file-system based rest.Config such as when using controller-runtime.
  • Loading branch information
andrewstucki authored Sep 16, 2024
1 parent 6d0c1f2 commit 58e0b75
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/kube/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand All @@ -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{
Expand Down

0 comments on commit 58e0b75

Please sign in to comment.