mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-18 04:54:54 +00:00
Address review comments and fix failing tests
This commit is contained in:
@@ -360,7 +360,7 @@ func (pl *CSILimits) checkCSIDriverOnNode(pluginName string, csiNode *storagev1.
|
||||
if apierrors.IsNotFound(err) {
|
||||
return true, nil
|
||||
}
|
||||
return false, err
|
||||
return false, fmt.Errorf("error getting CSIDriver for provider %s: %w", pluginName, err)
|
||||
}
|
||||
|
||||
if csiNode == nil {
|
||||
|
||||
@@ -25,33 +25,33 @@ import (
|
||||
|
||||
// DefaultCSIManager is an implementation of the CSIManager interface.
|
||||
type DefaultCSIManager struct {
|
||||
defaultCSINodeLister *csiNodeLister
|
||||
csiNodeLister *csiNodeListerWrapper
|
||||
}
|
||||
|
||||
var _ fwk.CSIManager = &DefaultCSIManager{}
|
||||
|
||||
func NewCSIManager(csiNodeLister storagelisters.CSINodeLister) *DefaultCSIManager {
|
||||
return &DefaultCSIManager{defaultCSINodeLister: NewCSINodeLister(csiNodeLister)}
|
||||
return &DefaultCSIManager{csiNodeLister: NewCSINodeLister(csiNodeLister)}
|
||||
}
|
||||
|
||||
func (m *DefaultCSIManager) CSINodes() fwk.CSINodeLister {
|
||||
return m.defaultCSINodeLister
|
||||
return m.csiNodeLister
|
||||
}
|
||||
|
||||
type csiNodeLister struct {
|
||||
type csiNodeListerWrapper struct {
|
||||
csiNodeLister storagelisters.CSINodeLister
|
||||
}
|
||||
|
||||
var _ fwk.CSINodeLister = &csiNodeLister{}
|
||||
var _ fwk.CSINodeLister = &csiNodeListerWrapper{}
|
||||
|
||||
func NewCSINodeLister(csinodeLister storagelisters.CSINodeLister) *csiNodeLister {
|
||||
return &csiNodeLister{csinodeLister: csinodeLister}
|
||||
func NewCSINodeLister(csiNodeLister storagelisters.CSINodeLister) *csiNodeListerWrapper {
|
||||
return &csiNodeListerWrapper{csiNodeLister: csiNodeLister}
|
||||
}
|
||||
|
||||
func (l *csiNodeLister) List() ([]*storagev1.CSINode, error) {
|
||||
return l.csinodeLister.List(labels.Everything())
|
||||
func (l *csiNodeListerWrapper) List() ([]*storagev1.CSINode, error) {
|
||||
return l.csiNodeLister.List(labels.Everything())
|
||||
}
|
||||
|
||||
func (l *csiNodeLister) Get(name string) (*storagev1.CSINode, error) {
|
||||
return l.csinodeLister.Get(name)
|
||||
func (l *csiNodeListerWrapper) Get(name string) (*storagev1.CSINode, error) {
|
||||
return l.csiNodeLister.Get(name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user