Commit 5aa177a8 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #37054 from tanshanshan/remove-repeat1

Automatic merge from submit-queue (batch tested with PRs 39695, 37054, 39627, 39546, 39615) remove repeating const declaration **What this PR does / why we need it**: remove repeating const declaration , and avoid const declaration in loop Thanks. **Special notes for your reviewer**: **Release note**: ```release-note ```
parents 844fa1b9 2e0ea0bf
...@@ -97,12 +97,10 @@ func isSysFSWritable() (bool, error) { ...@@ -97,12 +97,10 @@ func isSysFSWritable() (bool, error) {
} }
for _, mountPoint := range mountPoints { for _, mountPoint := range mountPoints {
const sysfsDevice = "sysfs"
if mountPoint.Type != sysfsDevice { if mountPoint.Type != sysfsDevice {
continue continue
} }
// Check whether sysfs is 'rw' // Check whether sysfs is 'rw'
const permWritable = "rw"
if len(mountPoint.Opts) > 0 && mountPoint.Opts[0] == permWritable { if len(mountPoint.Opts) > 0 && mountPoint.Opts[0] == permWritable {
return true, nil return true, nil
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment