kubernetes-sigs / aws-ebs-csi-driver

CSI driver for Amazon EBS https://aws.amazon.com/ebs/
Apache License 2.0
997 stars 798 forks source link

Restrict NVMe Metrics to EBS CSI Managed Volumes #2239

Closed ConnorJC3 closed 2 days ago

ConnorJC3 commented 5 days ago

What type of PR is this?

/kind bug

What is this PR about? / Why do we need it?

Fixes #2232

Instead of using only the kubelet path as a prefix, we should drill down specifically on where EBS CSI volumes are mounted so that nvme volumes from other drivers are not considered.

Also, normalizes the prefix in NewNVMECollector so that both kubeletPath with and without a trailing slash are accepted.

How was this change tested?

Manually tested + unit test changed + CI

Does this PR introduce a user-facing change?

Prevent attempting to query NVMe metrics of NVMe volumes from other CSI drivers
github-actions[bot] commented 5 days ago

Code Coverage Diff

This PR does not change the code coverage

AndrewSirenko commented 2 days ago

/approve

k8s-ci-robot commented 2 days ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AndrewSirenko

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/master/OWNERS)~~ [AndrewSirenko] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment