Skip to content

Commit 26bf5a3

Browse files
author
Murali Reddy
committed
In line with changes done for #17 ensure we check for both hostname and full FQDN
for the node name as kubelet can pass full FQDN for the node name
1 parent 0bfe869 commit 26bf5a3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

utils/pod_cidr.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,13 @@ func GetPodCidrFromNodeSpec(clientset *kubernetes.Clientset) (string, error) {
5252
if err != nil {
5353
panic(err.Error())
5454
}
55+
nodeFqdnHostName := GetFqdn()
5556
node, err := clientset.Core().Nodes().Get(nodeHostName, metav1.GetOptions{})
5657
if err != nil {
57-
panic(err.Error())
58+
node, err = clientset.Core().Nodes().Get(nodeFqdnHostName, metav1.GetOptions{})
59+
if err != nil {
60+
panic(err.Error())
61+
}
5862
}
5963
return node.Spec.PodCIDR, nil
6064
}

0 commit comments

Comments
 (0)