Adds a fix to include CA data in generated kubeconfig
@@ -974,7 +974,6 @@ func RunKubectlCommands(logger Logger, namespace string, commands []string, work
func Kubeconfig(cfg *rest.Config, w io.Writer) error {
var authProvider *api.AuthProviderConfig
var execConfig *api.ExecConfig
-
if cfg.AuthProvider != nil {
authProvider = &api.AuthProviderConfig{
Name: cfg.AuthProvider.Name,
@@ -997,7 +996,10 @@ func Kubeconfig(cfg *rest.Config, w io.Writer) error {
})
}
}
-
+ err := rest.LoadTLSFiles(cfg)
+ if err != nil {
+ return err
+ }
return json.NewYAMLSerializer(json.DefaultMetaFactory, nil, nil).Encode(&api.Config{
CurrentContext: "cluster",
Clusters: []api.NamedCluster{
