-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(cleanup): add cleanup of volumes from node to monitor func #142
Conversation
Signed-off-by: Payes Anand <[email protected]>
Signed-off-by: Payes Anand <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #142 +/- ##
=======================================
Coverage 42.47% 42.47%
=======================================
Files 12 12
Lines 412 412
=======================================
Hits 175 175
Misses 224 224
Partials 13 13 Continue to review full report at Codecov.
|
@@ -359,6 +364,9 @@ func (ns *node) NodeUnpublishVolume( | |||
} | |||
vol, err := utils.GetCStorVolumeAttachment(volumeID + "-" + utils.NodeIDENV) | |||
if err != nil { | |||
if k8serror.IsNotFound(err) { | |||
return &csi.NodeUnpublishVolumeResponse{}, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have log here saying cstorvolumeattachement not found
logrus.Infof("CstorVolumeAttachment %s was deleted or cannot be found: %s", volumeID, err.Error())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, I will add this log. Besides I will also add logs while creating and deleting CVAs
@@ -250,8 +251,12 @@ func (ns *node) NodeUnstageVolume( | |||
defer removeVolumeFromTransitionList(volumeID) | |||
|
|||
if vol, err = utils.GetCStorVolumeAttachment(volumeID + "-" + utils.NodeIDENV); err != nil { | |||
if k8serror.IsNotFound(err) { | |||
return &csi.NodeUnstageVolumeResponse{}, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have log here before retrun saying cstorvolumeattachement not found
logrus.Infof("CstorVolumeAttachment %s was deleted or cannot be found: %s", volumeID, err.Error())
Signed-off-by: Payes Anand <[email protected]>
return | ||
count := 0 | ||
for { | ||
if csivolList, err = GetVolListForNode(); err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this error out more than 5 times then the list will be empty and the error will not be logged as well. Can we log the error outside the for loop in that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it errors 5 times, we are returning an error to the caller function. If this func returns an error during startup, we will fatal out else we ignore the error. Will add one extra log if it errors 5 times.
Signed-off-by: Payes Anand <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
…#143) Signed-off-by: Payes Anand <[email protected]>
This PR addresses the following:
Signed-off-by: Payes Anand [email protected]