Created
February 11, 2017 08:43
-
-
Save samuell/f987c82a34275e51e48c33e9aac6abad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"k8s.io/client-go/kubernetes" | |
"k8s.io/client-go/tools/clientcmd" | |
) | |
var ( | |
kubeconfig = flag.String("kubeconfig", "/home/samuel/.kube/config", "absolute path to the kubeconfig file") | |
) | |
func main() { | |
flag.Parse() | |
config, err := clientcmd.BuildConfigFromFlags("", *kubeconfig) | |
check(err) | |
clientset, err := kubernetes.NewForConfig(config) | |
check(err) | |
clientset.Jobs(clientset.Namespaces().Get("default")) | |
} | |
func check(err error) { | |
if err != nil { | |
panic(err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should try
clientset.BatchV1Client.Jobs("").Get(...)