Skip to content

Commit

Permalink
extend for fastpath
Browse files Browse the repository at this point in the history
Signed-off-by: Lakshmi Narasimhan Sundararajan <[email protected]>
  • Loading branch information
Lakshmi Narasimhan Sundararajan committed Nov 9, 2020
1 parent 26d651e commit 73a86b2
Show file tree
Hide file tree
Showing 3 changed files with 20,893 additions and 12,564 deletions.
32 changes: 32 additions & 0 deletions handler/volume/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,38 @@ func (p *VolumeDescribeFormatter) addVolumeBasicInfo(
if len(v.GetLocator().GetVolumeLabels()) != 0 {
util.AddMap(t, "Labels:", v.GetLocator().GetVolumeLabels())
}

// Extend for reporting fastpath info
t.AddLine("Fastpath preferred:", spec.GetFpPreference())
fpConfig := v.GetFpConfig()
if spec.GetFpPreference() && fpConfig != nil {
t.AddLine("Fastpath Promoted:", fpConfig.GetPromote())
t.AddLine("Fastpath dirty:", fpConfig.GetDirty())
t.AddLine("Fastpath state:", fpConfig.GetStatus())
t.AddLine("Fastpath Coordinator:", fpConfig.GetCoordUuid())
t.AddLine("Fastpath replicas:", len(fpConfig.GetReplicas()))
for i, r := range fpConfig.GetReplicas() {
t.AddLine("Replica:", i)
t.AddLine("\tOn Node:", r.GetNodeUuid())
t.AddLine("\tProtocol:", r.GetProtocol())
t.AddLine("\tSecure:", r.GetAcl())
t.AddLine("\tExported:", r.GetExported())
if r.GetExported() {
t.AddLine("\t\tTarget:", r.GetTarget())
t.AddLine("\t\tSource:", r.GetExportedDevice())
if r.GetBlock() {
t.AddLine("\t\tType: BlockDevice")
} else {
t.AddLine("\t\tType: File")
}
}

t.AddLine("\tImported:", r.GetImported())
if r.Imported {
t.AddLine("\t\tMapped local device:", r.GetDevpath())
}
}
}
return nil
}

Expand Down
Loading

0 comments on commit 73a86b2

Please sign in to comment.