client-go/tools/clientcmd&#34;

  versionedclient &#34;istio.io/client-go/pkg/clientset/versioned&#34;
)

func main() {
  kubeconfig := os.Getenv(&#34;KUBECONFIG&#34;)
  namespace := os.Getenv(&#34;NAMESPACE&#34;)
  if len(kubeconfig) == 0 || len(namespace) == 0 {
    log.Fatalf(&#34;Environment variables KUBECONFIG and NAMESPACE need to be set&#34;)
  }
  restConfig, err := clientcmd.BuildConfigFromFlags(&#34;&#34;, kubeconfig)
  if err != nil {
    log.Fatalf(&#34;Failed to create k8s rest client: %s&#34;