Skip to content

Commit

Permalink
Fixed GetClientConfigFromRestConfig function.
Browse files Browse the repository at this point in the history
The preflight's Operator checks were failing because the
clientcmdapi.Config struct wasn't filled up properly.
  • Loading branch information
greyerof committed Oct 20, 2023
1 parent 7c150e4 commit 2003f77
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions internal/clientsholder/clientsholder.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ func GetClientConfigFromRestConfig(restConfig *rest.Config) *clientcmdapi.Config
APIVersion: "v1",
Clusters: map[string]*clientcmdapi.Cluster{
"default-cluster": {
Server: restConfig.Host,
CertificateAuthorityData: restConfig.CAData,
Server: restConfig.Host,
CertificateAuthority: restConfig.TLSClientConfig.CAFile,
},
},
Contexts: map[string]*clientcmdapi.Context{
Expand All @@ -186,8 +186,7 @@ func GetClientConfigFromRestConfig(restConfig *rest.Config) *clientcmdapi.Config
CurrentContext: "default-context",
AuthInfos: map[string]*clientcmdapi.AuthInfo{
"default-user": {
ClientCertificateData: restConfig.CertData,
ClientKeyData: restConfig.KeyData,
Token: restConfig.BearerToken,
},
},
}
Expand Down

0 comments on commit 2003f77

Please sign in to comment.