add judgement about truncate for 'NameBelongsToCluster'
This commit is contained in:
parent
0d80f0db33
commit
50e7c19b5f
1 changed files with 7 additions and 1 deletions
|
@ -206,7 +206,13 @@ func (n *Namer) NameBelongsToCluster(name string) bool {
|
||||||
glog.Warningf("Too many parts to name %v, ignoring", name)
|
glog.Warningf("Too many parts to name %v, ignoring", name)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(name) > nameLenLimit {
|
||||||
|
glog.V(4).Infof("%s has been truncated", name)
|
||||||
|
return strings.HasPrefix(clusterName, strings.TrimSuffix(parts[1], alphaNumericChar))
|
||||||
|
}else{
|
||||||
return parts[1] == clusterName
|
return parts[1] == clusterName
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// BeName constructs the name for a backend.
|
// BeName constructs the name for a backend.
|
||||||
|
|
Loading…
Reference in a new issue