mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-09-27 20:38:11 +00:00
Fix a wait to account for the possiblity of a not ready unix socket (#1207)
This commit is contained in:
@@ -24,8 +24,6 @@ import (
|
|||||||
cnitypes "github.com/containernetworking/cni/pkg/types"
|
cnitypes "github.com/containernetworking/cni/pkg/types"
|
||||||
|
|
||||||
"gopkg.in/k8snetworkplumbingwg/multus-cni.v4/pkg/logging"
|
"gopkg.in/k8snetworkplumbingwg/multus-cni.v4/pkg/logging"
|
||||||
|
|
||||||
utilwait "k8s.io/apimachinery/pkg/util/wait"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// ShimNetConf for the SHIM cni config file written in json
|
// ShimNetConf for the SHIM cni config file written in json
|
||||||
@@ -90,10 +88,7 @@ func postRequest(args *skel.CmdArgs) (*Response, string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var body []byte
|
var body []byte
|
||||||
err = utilwait.PollImmediate(APIReadyPollDuration, APIReadyPollTimeout, func() (bool, error) {
|
body, err = DoCNI("http://dummy/cni", cniRequest, SocketPath(multusShimConfig.MultusSocketDir))
|
||||||
body, err = DoCNI("http://dummy/cni", cniRequest, SocketPath(multusShimConfig.MultusSocketDir))
|
|
||||||
return err == nil, nil
|
|
||||||
})
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, multusShimConfig.CNIVersion, err
|
return nil, multusShimConfig.CNIVersion, err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user