Skip to content

Commit

Permalink
debug csinode e2e flak
Browse files Browse the repository at this point in the history
  • Loading branch information
Elbehery committed May 18, 2021
1 parent 9d99e1c commit 1054ea0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/volume/csi/csi_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -960,12 +960,14 @@ func (p *csiPlugin) newAttacherDetacher() (*csiAttacher, error) {
}

func unregisterDriver(driverName string) error {
klog.Infof("Starting un-registering CSIDriver %v", driverName)
csiDrivers.Delete(driverName)

if err := nim.UninstallCSIDriver(driverName); err != nil {
return errors.New(log("Error uninstalling CSI driver: %v", err))
}

klog.Infof("Finishing un-registering CSIDriver %v", driverName)
return nil
}

Expand Down
5 changes: 4 additions & 1 deletion pkg/volume/csi/nodeinfomanager/nodeinfomanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ func NewNodeInfoManager(
// If multiple calls to InstallCSIDriver() are made in parallel, some calls might receive Node or
// CSINode update conflicts, which causes the function to retry the corresponding update.
func (nim *nodeInfoManager) InstallCSIDriver(driverName string, driverNodeID string, maxAttachLimit int64, topology map[string]string) error {
klog.Infof("Starting installing CSIDriver %v on Node %v", driverName, driverNodeID)
if driverNodeID == "" {
return fmt.Errorf("error adding CSI driver node info: driverNodeID must not be empty")
}
Expand All @@ -125,7 +126,7 @@ func (nim *nodeInfoManager) InstallCSIDriver(driverName string, driverNodeID str
if err != nil {
return fmt.Errorf("error updating CSINode object with CSI driver node info: %v", err)
}

klog.Infof("Finishing installing CSIDriver %v on Node %v", driverName, driverNodeID)
return nil
}

Expand All @@ -134,6 +135,7 @@ func (nim *nodeInfoManager) InstallCSIDriver(driverName string, driverNodeID str
// If multiple calls to UninstallCSIDriver() are made in parallel, some calls might receive Node or
// CSINode update conflicts, which causes the function to retry the corresponding update.
func (nim *nodeInfoManager) UninstallCSIDriver(driverName string) error {
klog.Infof("Starting un-installing CSIDriver %v", driverName)
err := nim.uninstallDriverFromCSINode(driverName)
if err != nil {
return fmt.Errorf("error uninstalling CSI driver from CSINode object %v", err)
Expand All @@ -146,6 +148,7 @@ func (nim *nodeInfoManager) UninstallCSIDriver(driverName string) error {
if err != nil {
return fmt.Errorf("error removing CSI driver node info from Node object %v", err)
}
klog.Infof("Finishing un-installing CSIDriver %v", driverName)
return nil
}

Expand Down

0 comments on commit 1054ea0

Please sign in to comment.