openebs-archive / node-disk-manager

Kubernetes Storage Device Management
https://openebs.io/docs
Apache License 2.0
182 stars 113 forks source link

fix(sysfs): trim newline while parsing sysfs files #666

Closed akhilerm closed 2 years ago

akhilerm commented 2 years ago

Signed-off-by: Akhil Mohan akhil.mohan@datacore.com

Why is this PR required? What issue does it fix?: sysfs files like dm/uuid etc are sometimes suffixed by a newline character which need to be trimmed off for correct parsing, else it will result in incorrect device type being detected

What this PR does?: trim the newline suffix while reading from sysfs

Does this PR require any upgrade changes?:

If the changes in this PR are manually verified, list down the scenarios covered::

Any additional information for your reviewer? : Mention if this PR is part of any design or a continuation of previous PRs

Checklist:

codecov-commenter commented 2 years ago

Codecov Report

Merging #666 (e800cb5) into develop (7094461) will increase coverage by 0.27%. The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #666      +/-   ##
===========================================
+ Coverage    44.78%   45.06%   +0.27%     
===========================================
  Files           79       79              
  Lines         3970     3970              
===========================================
+ Hits          1778     1789      +11     
+ Misses        2024     2016       -8     
+ Partials       168      165       -3     
Impacted Files Coverage Δ
pkg/sysfs/syspath.go 84.16% <ø> (+1.66%) :arrow_up:
pkg/sysfs/util.go 81.81% <100.00%> (ø)
cmd/ndm_daemonset/probe/addhandler.go 68.95% <0.00%> (+0.98%) :arrow_up:
cmd/ndm_daemonset/probe/udevprobe.go 49.01% <0.00%> (+2.37%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7094461...e800cb5. Read the comment docs.