func NewIstioClient(kubeConfig string) (*istiocrd.Client, error) {
	if kubeConfig == "" {
		if _, err := os.Stat(clientcmd.RecommendedHomeFile); err == nil {
			kubeConfig = clientcmd.RecommendedHomeFile
		}
	}

	client, err := istiocrd.NewClient(
		kubeConfig,
		"",
		istiomodel.ConfigDescriptor{istiomodel.Gateway},
		"",
	)
	if err != nil {
		return nil, err
	}

	log.Info("Created Istio client")

	return client, nil
}
func NewIstioClient(kubeConfig string) (*istiocrd.Client, error) {
	if kubeConfig == "" {
		if _, err := os.Stat(clientcmd.RecommendedHomeFile); err == nil {
			kubeConfig = clientcmd.RecommendedHomeFile
		}
	}

	client, err := istiocrd.NewClient(
		kubeConfig,
		"",
		istiomodel.ConfigDescriptor{istiomodel.Gateway},
		"",
	)
	if err != nil {
		return nil, err
	}

	log.Info("Created Istio client")

	return client, nil
}
// NewIstioClient returns a new Istio client object. It uses the configured
// KubeConfig attribute to connect to the cluster. If KubeConfig isn't provided
// it defaults to using the recommended default.
// NB: Istio controls the creation of the underlying Kubernetes client, so we
// have no ability to tack on transport wrappers (e.g., Prometheus request
// wrappers) to the client's config at this level. Furthermore, the Istio client
// constructor does not expose the ability to override the Kubernetes master,
// so the Master config attribute has no effect.