Skip to content

Commit

Permalink
Adds a fix to include CA data in generated kubeconfig (#1226)
Browse files Browse the repository at this point in the history
Signed-off-by: faiq <faiqrazarizvi@gmail.com>
  • Loading branch information
faiq authored and kensipe committed Dec 27, 2019
1 parent 854feb2 commit fddf492
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/test/utils/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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{
Expand Down

0 comments on commit fddf492

Please sign in to comment.