mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-13 13:55:41 +00:00
fix warning when using CSI driver to expand volume
Signed-off-by: hoyho <luohaihao@gmail.com>
This commit is contained in:
parent
a06568062c
commit
02197a9924
@ -17,6 +17,7 @@ limitations under the License.
|
||||
package volume
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"strings"
|
||||
@ -62,6 +63,8 @@ const (
|
||||
ProbeRemove
|
||||
)
|
||||
|
||||
var ErrNoPluiginMatched = errors.New("no volume plugin matched")
|
||||
|
||||
// VolumeOptions contains option information about a volume.
|
||||
type VolumeOptions struct {
|
||||
// The attributes below are required by volume.Provisioner
|
||||
@ -649,7 +652,7 @@ func (pm *VolumePluginMgr) FindPluginBySpec(spec *Spec) (VolumePlugin, error) {
|
||||
}
|
||||
|
||||
if len(matchedPluginNames) == 0 {
|
||||
return nil, fmt.Errorf("no volume plugin matched")
|
||||
return nil, ErrNoPluiginMatched
|
||||
}
|
||||
if len(matchedPluginNames) > 1 {
|
||||
return nil, fmt.Errorf("multiple volume plugins matched: %s", strings.Join(matchedPluginNames, ","))
|
||||
@ -876,6 +879,9 @@ func (pm *VolumePluginMgr) FindExpandablePluginBySpec(spec *Spec) (ExpandableVol
|
||||
klog.V(4).InfoS("FindExpandablePluginBySpec -> returning noopExpandableVolumePluginInstance", "specName", spec.Name())
|
||||
return &noopExpandableVolumePluginInstance{spec}, nil
|
||||
}
|
||||
if errors.Is(err, ErrNoPluiginMatched) {
|
||||
return nil, nil
|
||||
}
|
||||
klog.V(4).InfoS("FindExpandablePluginBySpec -> err", "specName", spec.Name(), "err", err)
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user