Skip to content

Commit

Permalink
Fix a wait to account for the possiblity of a not ready unix socket (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
s1061123 authored Jan 11, 2024
1 parent 003fbd5 commit a70da35
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions pkg/server/api/shim.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import (
cnitypes "github.com/containernetworking/cni/pkg/types"

"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
Expand Down Expand Up @@ -90,10 +88,7 @@ func postRequest(args *skel.CmdArgs) (*Response, string, error) {
}

var body []byte
err = utilwait.PollImmediate(APIReadyPollDuration, APIReadyPollTimeout, func() (bool, error) {
body, err = DoCNI("http://dummy/cni", cniRequest, SocketPath(multusShimConfig.MultusSocketDir))
return err == nil, nil
})
body, err = DoCNI("http://dummy/cni", cniRequest, SocketPath(multusShimConfig.MultusSocketDir))
if err != nil {
return nil, multusShimConfig.CNIVersion, err
}
Expand Down

0 comments on commit a70da35

Please sign in to comment.