func ParseKubernetesClientConfig(kubeConfig string) (*clientCmdApi.Config, error) {
	var clientCfg *clientCmdApi.Config
	var err error
	if kubeConfig != "" {
		clientCfg, err = clientcmd.LoadFromFile(kubeConfig)
		if err != nil {
			return nil, errors.New(fmt.Sprintf("failed to load kubeconfig from %s: %s", kubeConfig, err))
		}
	} else {
		clientCfg, err = clientcmd.NewDefaultClientConfigLoadingRules().Load()
		if err != nil {
			return nil, errors.New(fmt.Sprintf("failed to load kubeconfig from the default locations: %s", err))
		}
	}
	return clientCfg, nil
}
parse the k8s config
package utils
import (
	"errors"
	"fmt"
	"math/rand"
	"os/exec"
	"runtime"
	"k8s.io/client-go/tools/clientcmd"
	clientCmdApi "k8s.io/client-go/tools/clientcmd/api"
)
func RandomString() string {
	var letter = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._+")
	b := make([]rune, 64)
	for i := range b {
		b[i] = letter[rand.Intn(len(letter))]
	}
	return string(b)
}
func OpenURL(url string) error {
	var cmd string
	var args []string
	switch os := runtime.GOOS; os {
	case "darwin":
		cmd = "open"
	case "linux":
		cmd = "xdg-open"
	case "windows":
		cmd = "rundll32"
		args = []string{"url.dll,FileProtocolHandler"}
	}
	args = append(args, url)
	err := exec.Command(cmd, args...).Start()
	if err != nil {
		return errors.New(fmt.Sprintf("command '%s' failed: %s", cmd, err))
	}
	return nil
}