Use ClientConfig to configure connection

This commit is contained in:
Manuel de Brito Fontes 2016-08-02 10:46:35 -04:00
parent 1abf443742
commit 0f70b80745
3 changed files with 15 additions and 22 deletions

View file

@ -119,6 +119,10 @@ func getPodDetails(kubeClient *unversioned.Client) (*podInfo, error) {
podName := os.Getenv("POD_NAME")
podNs := os.Getenv("POD_NAMESPACE")
if podName == "" && podNs == "" {
return nil, fmt.Errorf("unable to get POD information (missing POD_NAME or POD_NAMESPACE environment variable")
}
err := waitForPodRunning(kubeClient, podNs, podName, time.Millisecond*200, time.Second*30)
if err != nil {
return nil, err
@ -126,7 +130,7 @@ func getPodDetails(kubeClient *unversioned.Client) (*podInfo, error) {
pod, _ := kubeClient.Pods(podNs).Get(podName)
if pod == nil {
return nil, fmt.Errorf("Unable to get POD information")
return nil, fmt.Errorf("unable to get POD information")
}
node, err := kubeClient.Nodes().Get(pod.Spec.NodeName)