1 Commits

Author SHA1 Message Date
R.B. Boyer
00d74abc4a
metadata: memoize the parsed build versions (#22113)
There will only be a small set of consul build versions that a single consul
server will witness. Inside of metadata.IsConsulServer we use a very
expensive function in the hashicorp/go-version library to parse these into
read-only *version.Version structs all over Consul.

Memoize these in a package cache map. Likely the thing will only have like
2 keys in it ever over the life of the process.
2025-02-03 16:22:10 -06:00