clusterCompatibleForVersion checks whether a compatible cluster found If not, then it checks whether the current cluster compatibility version is greater than or equal the given app version.
( version string)
| 163 | // If not, then it checks whether the current cluster compatibility |
| 164 | // version is greater than or equal the given app version. |
| 165 | func (vt *clusterVersionTracker) clusterCompatibleForVersion( |
| 166 | version string) bool { |
| 167 | // if already a compatible cluster found then exit early to |
| 168 | // avoid compatibility version parsing. |
| 169 | if atomic.LoadInt32(&vt.found) == 1 { |
| 170 | return true |
| 171 | } |
| 172 | |
| 173 | givenVersion, err := cbgt.CompatibilityVersion(version) |
| 174 | if err == nil && vt.clusterVersion != 0 && |
| 175 | vt.clusterVersion >= givenVersion { |
| 176 | return true |
| 177 | } |
| 178 | |
| 179 | return false |
| 180 | } |
| 181 | |
| 182 | func getEffectiveClusterVersion(server string) (uint64, error) { |
| 183 | if len(server) < 2 { |
no outgoing calls
no test coverage detected