Skip to content

Commit

Permalink
add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Atanas Todorov committed Dec 16, 2024
1 parent e39b088 commit 5643f86
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion starlark/use.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
kcpclient "github.com/kcp-dev/kcp/pkg/client/clientset/versioned"
"github.com/kcp-dev/logicalcluster/v3"
"github.com/pkg/errors"
"gopkg.in/yaml.v2"
"k8s.io/client-go/tools/clientcmd"
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
"log"
Expand Down Expand Up @@ -53,7 +54,12 @@ func NewUseWorkspaceCommand(workspace string, kubeConfig *clientcmdapi.Config, k
Name: workspace,

modifyConfig: func(newConfig *clientcmdapi.Config, kubeconfigPath string) error {
err := clientcmd.WriteToFile(*newConfig, kubeconfigPath)
yamlData, err := yaml.Marshal(newConfig)
if err != nil {
return err
}
fmt.Println(string(yamlData))
err = clientcmd.WriteToFile(*newConfig, kubeconfigPath)
if err != nil {
return err
}
Expand Down

0 comments on commit 5643f86

Please sign in to comment.