diff --git a/go.mod b/go.mod index 11e811b987..874d068471 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/imdario/mergo v0.3.16 // indirect - github.com/kubernetes-csi/csi-lib-utils v0.18.0 + github.com/kubernetes-csi/csi-lib-utils v0.18.1 github.com/kubernetes-csi/csi-test/v5 v5.2.0 github.com/kubernetes-csi/external-snapshotter/client/v6 v6.3.0 github.com/miekg/dns v1.1.59 // indirect diff --git a/go.sum b/go.sum index 4738139ed1..7ecb69aaf3 100644 --- a/go.sum +++ b/go.sum @@ -109,8 +109,8 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kubernetes-csi/csi-lib-utils v0.18.0 h1:Tpt1qLIbmpz5ux1hllut/dEWww2VRxdvSSOF4gGwhnA= -github.com/kubernetes-csi/csi-lib-utils v0.18.0/go.mod h1:FEQIcHcZmXZKWKTg18dJbXCHvgtCjnH7/uM0trmZyhU= +github.com/kubernetes-csi/csi-lib-utils v0.18.1 h1:vpg1kbQ6lFVCz7mY71zcqVE7W0GAQXXBoFfHvbW3gdw= +github.com/kubernetes-csi/csi-lib-utils v0.18.1/go.mod h1:PIcn27zmbY0KBue4JDdZVfDF56tjcS3jKroZPi+pMoY= github.com/kubernetes-csi/csi-test/v5 v5.2.0 h1:Z+sdARWC6VrONrxB24clCLCmnqCnZF7dzXtzx8eM35o= github.com/kubernetes-csi/csi-test/v5 v5.2.0/go.mod h1:o/c5w+NU3RUNE+DbVRhEUTmkQVBGk+tFOB2yPXT8teo= github.com/kubernetes-csi/external-snapshotter/client/v6 v6.3.0 h1:qS4r4ljINLWKJ9m9Ge3Q3sGZ/eIoDVDT2RhAdQFHb1k= diff --git a/vendor/github.com/kubernetes-csi/csi-lib-utils/rpc/common.go b/vendor/github.com/kubernetes-csi/csi-lib-utils/rpc/common.go index c794267c6d..f83a7f15cf 100644 --- a/vendor/github.com/kubernetes-csi/csi-lib-utils/rpc/common.go +++ b/vendor/github.com/kubernetes-csi/csi-lib-utils/rpc/common.go @@ -136,32 +136,35 @@ func GetGroupControllerCapabilities(ctx context.Context, conn *grpc.ClientConn) func ProbeForever(ctx context.Context, conn *grpc.ClientConn, singleProbeTimeout time.Duration) error { logger := klog.FromContext(ctx) ticker := time.NewTicker(probeInterval) + defer ticker.Stop() for { + // Run the probe once before waiting for the ticker + logger.Info("Probing CSI driver for readiness") + ready, err := probeOnce(ctx, conn, singleProbeTimeout) + if err != nil { + st, ok := status.FromError(err) + if !ok { + // This is not gRPC error. The probe must have failed before gRPC + // method was called, otherwise we would get gRPC error. + return fmt.Errorf("CSI driver probe failed: %s", err) + } + if st.Code() != codes.DeadlineExceeded { + return fmt.Errorf("CSI driver probe failed: %s", err) + } + // Timeout -> driver is not ready. Fall through to sleep() below. + logger.Info("CSI driver probe timed out") + } else { + if ready { + return nil + } + logger.Info("CSI driver is not ready") + } select { case <-ctx.Done(): return ctx.Err() case <-ticker.C: - logger.Info("Probing CSI driver for readiness") - ready, err := probeOnce(ctx, conn, singleProbeTimeout) - if err != nil { - st, ok := status.FromError(err) - if !ok { - // This is not gRPC error. The probe must have failed before gRPC - // method was called, otherwise we would get gRPC error. - return fmt.Errorf("CSI driver probe failed: %s", err) - } - if st.Code() != codes.DeadlineExceeded { - return fmt.Errorf("CSI driver probe failed: %s", err) - } - // Timeout -> driver is not ready. Fall through to sleep() below. - logger.Info("CSI driver probe timed out") - } else { - if ready { - return nil - } - logger.Info("CSI driver is not ready") - } + continue } } } diff --git a/vendor/modules.txt b/vendor/modules.txt index aa845ce023..51e1023e44 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -166,7 +166,7 @@ github.com/josharian/intern # github.com/json-iterator/go v1.1.12 ## explicit; go 1.12 github.com/json-iterator/go -# github.com/kubernetes-csi/csi-lib-utils v0.18.0 +# github.com/kubernetes-csi/csi-lib-utils v0.18.1 ## explicit; go 1.22.0 github.com/kubernetes-csi/csi-lib-utils/accessmodes github.com/kubernetes-csi/csi-lib-utils/connection