Skip to content

Commit

Permalink
fix: filter by svm, volume in SM destination dashboard (#3220)
Browse files Browse the repository at this point in the history
* fix: filter by svm, volume in SM destination dashboard
  • Loading branch information
Hardikl authored Oct 30, 2024
1 parent dbd23ae commit 9cad88e
Show file tree
Hide file tree
Showing 2 changed files with 293 additions and 274 deletions.
9 changes: 9 additions & 0 deletions cmd/collectors/rest/plugins/snapmirror/snapmirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/netapp/harvest/v2/pkg/util"
"log/slog"
"path/filepath"
"slices"
"strings"
"time"
)
Expand Down Expand Up @@ -231,6 +232,7 @@ func (m *SnapMirror) updateSMLabels(data *matrix.Matrix) {

func (m *SnapMirror) handleCGRelationships(data *matrix.Matrix, keys []string) {
for _, key := range keys {
var cgSourceVolumes, cgDestinationVolumes []string
cgInstance := data.GetInstance(key)
// find cgName from the destination_location, source_location
cgInstance.SetLabel("destination_cg_name", filepath.Base(cgInstance.GetLabel("destination_location")))
Expand Down Expand Up @@ -267,8 +269,15 @@ func (m *SnapMirror) handleCGRelationships(data *matrix.Matrix, keys []string) {
cgVolumeInstance.SetLabel("relationship_id", "")
cgVolumeInstance.SetLabel("source_volume", sourceVol)
cgVolumeInstance.SetLabel("destination_volume", destinationVol)
cgSourceVolumes = append(cgSourceVolumes, sourceVol)
cgDestinationVolumes = append(cgDestinationVolumes, destinationVol)
}
}
// Update parent CG source and destination volumes
slices.Sort(cgSourceVolumes)
slices.Sort(cgDestinationVolumes)
cgInstance.SetLabel("source_volume", strings.Join(cgSourceVolumes, ","))
cgInstance.SetLabel("destination_volume", strings.Join(cgDestinationVolumes, ","))
}
}

Expand Down
Loading

0 comments on commit 9cad88e

Please sign in to comment.