Isol. CPU plugin on startup: wait for kubelet.sock to be ready
Change-Id: I9645af7609cab8703fe22e05125fbf2fcfb2d20c Signed-off-by: Kaustubh Dhokte <kaustubh.dhokte@windriver.com>
This commit is contained in:
parent
0ce84f0495
commit
67df801466
@ -211,6 +211,13 @@ func (srv *server) setupAndServe(namespace string, devicePluginPath string, kube
|
|||||||
pluginEndpoint := pluginPrefix + ".sock"
|
pluginEndpoint := pluginPrefix + ".sock"
|
||||||
pluginSocket := path.Join(devicePluginPath, pluginEndpoint)
|
pluginSocket := path.Join(devicePluginPath, pluginEndpoint)
|
||||||
|
|
||||||
|
//Wait for the kubelet RPC server to start
|
||||||
|
if err := waitForServer(kubeletSocket, 60*time.Second); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println("Connection test successful with the kubelet socket at", kubeletSocket)
|
||||||
|
|
||||||
if err := waitForServer(pluginSocket, time.Second); err == nil {
|
if err := waitForServer(pluginSocket, time.Second); err == nil {
|
||||||
return errors.Errorf("Socket %s is already in use", pluginSocket)
|
return errors.Errorf("Socket %s is already in use", pluginSocket)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user