Merge "isolcpu_plugin: wait for kubelet.sock to be ready"

This commit is contained in:
Zuul
2024-05-07 15:47:15 +00:00
committed by Gerrit Code Review

View File

@@ -211,6 +211,13 @@ func (srv *server) setupAndServe(namespace string, devicePluginPath string, kube
pluginEndpoint := pluginPrefix + ".sock"
pluginSocket := path.Join(devicePluginPath, pluginEndpoint)
// Wait for the kubelet RPC server to start
if err := waitForServer(kubeletSocket, 60*time.Second); err != nil {
return errors.Wrap(err, "Kubelet socket connection test failed")
}
fmt.Println("Connection test successful with the kubelet socket at", kubeletSocket)
if err := waitForServer(pluginSocket, time.Second); err == nil {
return errors.Errorf("Socket %s is already in use", pluginSocket)
}