Skip to content

Commit

Permalink
Make storage filter name sentence cased
Browse files Browse the repository at this point in the history
This will add storage view along with pods and storage components.

Signed-off-by: Satyam Zode <satyam.zode@openebs.io>
  • Loading branch information
Satyam Zode committed Jun 7, 2018
1 parent d39b78d commit 8c08737
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 25 deletions.
4 changes: 2 additions & 2 deletions app/api_topologies.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ var (
ID: "storage",
Default: "hide",
Options: []APITopologyOption{
{Value: "show", Label: "Show Storage", filter: render.IsVolumesComponent, filterPseudo: false},
{Value: "hide", Label: "Hide Storage", filter: render.IsPodComponent, filterPseudo: false},
{Value: "show", Label: "Show storage", filter: nil, filterPseudo: false},
{Value: "hide", Label: "Hide storage", filter: render.IsPodComponent, filterPseudo: false},
},
}
)
Expand Down
8 changes: 4 additions & 4 deletions probe/kubernetes/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ var (

PersistentVolumeMetadataTemplates = report.MetadataTemplates{
NodeType: {ID: NodeType, Label: "Type", From: report.FromLatest, Priority: 1},
VolumeClaim: {ID: VolumeClaim, Label: "Volume Claim", From: report.FromLatest, Priority: 2},
StorageClassName: {ID: StorageClassName, Label: "Storage Class", From: report.FromLatest, Priority: 3},
AccessModes: {ID: AccessModes, Label: "Access Modes", From: report.FromLatest, Priority: 5},
VolumeClaim: {ID: VolumeClaim, Label: "Volume claim", From: report.FromLatest, Priority: 2},
StorageClassName: {ID: StorageClassName, Label: "Storage class", From: report.FromLatest, Priority: 3},
AccessModes: {ID: AccessModes, Label: "Access modes", From: report.FromLatest, Priority: 5},
Status: {ID: Status, Label: "Status", From: report.FromLatest, Priority: 6},
}

Expand All @@ -119,7 +119,7 @@ var (
Namespace: {ID: Namespace, Label: "Namespace", From: report.FromLatest, Priority: 2},
Status: {ID: Status, Label: "Status", From: report.FromLatest, Priority: 3},
VolumeName: {ID: VolumeName, Label: "Volume", From: report.FromLatest, Priority: 4},
StorageClassName: {ID: StorageClassName, Label: "Storage Class", From: report.FromLatest, Priority: 5},
StorageClassName: {ID: StorageClassName, Label: "Storage class", From: report.FromLatest, Priority: 5},
}

StorageClassMetadataTemplates = report.MetadataTemplates{
Expand Down
19 changes: 0 additions & 19 deletions render/filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,25 +128,6 @@ func IsConnected(node report.Node) bool {
return ok
}

// IsVolumesComponent check whether given node is PV, PVC, SC or not
func IsVolumesComponent(node report.Node) bool {
var storageComponent bool
if node.Topology == "persistent_volume" || node.Topology == "persistent_volume_claim" || node.Topology == "storage_class" {
storageComponent = true
}
if node.Topology == "pod" {
volumeClaim, ok := node.Latest.Lookup(kubernetes.VolumeClaim)
if !ok {
storageComponent = false
} else if volumeClaim == "" {
storageComponent = false
} else {
storageComponent = true
}
}
return storageComponent
}

// IsPodComponent check whether given node is everything but PV, PVC, SC
func IsPodComponent(node report.Node) bool {
var ok bool
Expand Down

0 comments on commit 8c08737

Please sign in to comment.