Conversation
cgrinds
reviewed
May 29, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds logic to exclude offline volumes in MC (Multi-Cluster) SVMs from export and validates it in tests for the REST plugin
- Filter out volumes with state "offline" in SVMs ending with
-mcin both ZAPI and REST collectors - Introduce
TestMCCVolumesunit test to validate exportable flags for the REST plugin
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| cmd/collectors/zapi/plugins/volume/volume.go | Add offline MC-SVM volume check in processAndUpdateVolume |
| cmd/collectors/rest/plugins/volume/volume.go | Add offline MC-SVM volume check in updateVolumeLabels |
| cmd/collectors/rest/plugins/volume/volume_test.go | Add TestMCCVolumes to verify REST plugin exportable logic |
Comments suppressed due to low confidence (4)
cmd/collectors/zapi/plugins/volume/volume.go:158
- No unit test covers the offline MC-SVM exportable logic in the ZAPI plugin; consider adding tests for
processAndUpdateVolumeto validate this behavior.
if volState == "offline" && strings.HasSuffix(svm, "-mc") {
cmd/collectors/zapi/plugins/volume/volume.go:123
- [nitpick] Variable
volStatecould be renamed tovolumeStateorstateLabelfor improved clarity.
volState := volume.GetLabel("state")
cmd/collectors/rest/plugins/volume/volume.go:189
- Missing import of the "strings" package; this reference to strings.HasSuffix will cause a compile error. Add
import "strings"at the top.
if volState == "offline" && strings.HasSuffix(svm, "-mc") {
cmd/collectors/zapi/plugins/volume/volume.go:158
- [nitpick] This offline MC-SVM filter logic also appears in the REST plugin; consider extracting it into a shared helper to reduce duplication.
if volState == "offline" && strings.HasSuffix(svm, "-mc") {
cgrinds
approved these changes
May 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.