MCPcopy
hub / github.com/etcd-io/etcd / minSupportedVersion

Function minSupportedVersion

client/v3/client.go:503–516  ·  view source on GitHub ↗

minSupportedVersion returns the minimum version supported, which is the previous minor release.

()

Source from the content-addressed store, hash-verified

501
502// minSupportedVersion returns the minimum version supported, which is the previous minor release.
503func minSupportedVersion() *semver.Version {
504 ver := semver.Must(semver.NewVersion(version.Version))
505 // consider only major and minor version
506 ver = &semver.Version{Major: ver.Major, Minor: ver.Minor}
507 for i := range version.AllVersions {
508 if version.AllVersions[i].Equal(*ver) {
509 if i == 0 {
510 return ver
511 }
512 return &version.AllVersions[i-1]
513 }
514 }
515 panic("current version is not in the version list")
516}
517
518func (c *Client) checkVersion() (err error) {
519 var wg sync.WaitGroup

Callers 3

TestMinSupportedVersionFunction · 0.85
checkVersionMethod · 0.85

Calls 1

EqualMethod · 0.65

Tested by 2

TestMinSupportedVersionFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…