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