package main import ( "log" "path/filepath" etcdv1 "github.com/coreos/etcd-operator/pkg/apis/etcd/v1beta2" etcdclient "github.com/coreos/etcd-operator/pkg/client" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" ) func main() { } func getConfig() (*rest.Config, error) { home := os.Getenv("HOME") if home == "" { log.Fatal("Unable to locate kubernetes config.") } kubeconfig := filepath.Join(home, ".kube", "config") config, err := clientcmd.BuildConfigFromFlags("", kubeconfig) if err != nil { log.Fatal(err) } } func createEtcdCluster(config *rest.Config, t *testing.T) { client := etcdclient.MustNew(config).EtcdClusters("default") clusters, err := client.List(metav1.ListOptions{}) if err != nil { t.Fatal(err) } t.Logf("There are %d etcd clusterst in the cluster.\n", len(clusters.Items)) }