Skip to content

Commit

Permalink
Set the Initialized condition to True after mounting on restart is co…
Browse files Browse the repository at this point in the history
…mpleted
  • Loading branch information
Praveenrajmani authored and wlan0 committed Aug 26, 2021
1 parent 2d6e608 commit 79bc6ed
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pkg/node/discovery/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,16 @@ func (d *Discovery) syncDrive(ctx context.Context, localDrive *directcsi.DirectC
syncDriveStatesOnDiscovery(existingDrive, localDrive)

// Verify mounts
message := ""
if err := d.verifyDriveMount(existingDrive); err != nil {
utils.UpdateCondition(existingDrive.Status.Conditions,
string(directcsi.DirectCSIDriveConditionInitialized),
metav1.ConditionFalse,
string(directcsi.DirectCSIDriveReasonInitialized),
err.Error())
message = err.Error()
klog.V(3).Infof("mounting failed with: %v", err)
}
utils.UpdateCondition(existingDrive.Status.Conditions,
string(directcsi.DirectCSIDriveConditionInitialized),
utils.BoolToCondition(message == ""),
string(directcsi.DirectCSIDriveReasonInitialized),
message)

updateOpts := metav1.UpdateOptions{
TypeMeta: utils.DirectCSIDriveTypeMeta(),
Expand Down

0 comments on commit 79bc6ed

Please sign in to comment.