mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
cleanup: address gomnd warnings
Direct usage of numbers should be avoided. Issue reported: mnd: Magic number: X, in <argument> detected (gomnd) Signed-off-by: Yug <yuggupta27@gmail.com>
This commit is contained in:
@ -52,7 +52,8 @@ func GetTopologyFromDomainLabels(domainLabels, nodeName, driverName string) (map
|
||||
|
||||
// size checks on domain label prefix
|
||||
topologyPrefix := strings.ToLower("topology." + driverName)
|
||||
if len(topologyPrefix) > 63 {
|
||||
const lenLimit = 63
|
||||
if len(topologyPrefix) > lenLimit {
|
||||
return nil, fmt.Errorf("computed topology label prefix (%s) for node exceeds length limits", topologyPrefix)
|
||||
}
|
||||
// driverName is validated, and we are adding a lowercase "topology." to it, so no validation for conformance
|
||||
|
Reference in New Issue
Block a user