2023-02-06 17:14:35 +00:00
|
|
|
package xdscommon
|
2020-07-31 20:52:49 +00:00
|
|
|
|
2022-12-20 17:58:19 +00:00
|
|
|
import "strings"
|
|
|
|
|
2020-07-31 20:52:49 +00:00
|
|
|
// EnvoyVersions lists the latest officially supported versions of envoy.
|
|
|
|
//
|
2020-08-26 15:04:11 +00:00
|
|
|
// This list must be sorted by semver descending. Only one point release for
|
|
|
|
// each major release should be present.
|
|
|
|
//
|
2020-07-31 20:52:49 +00:00
|
|
|
// see: https://www.consul.io/docs/connect/proxies/envoy#supported-versions
|
|
|
|
var EnvoyVersions = []string{
|
2023-04-12 22:08:45 +00:00
|
|
|
"1.25.4",
|
|
|
|
"1.24.6",
|
|
|
|
"1.23.8",
|
|
|
|
"1.22.11",
|
2020-07-31 20:52:49 +00:00
|
|
|
}
|
2022-12-20 17:58:19 +00:00
|
|
|
|
|
|
|
// UnsupportedEnvoyVersions lists any unsupported Envoy versions (mainly minor versions) that fall
|
|
|
|
// within the range of EnvoyVersions above.
|
|
|
|
// For example, if patch 1.21.3 (patch 3) had a breaking change, and was not supported
|
|
|
|
// even though 1.21 is a supported major release, you would then add 1.21.3 to this list.
|
|
|
|
// This list will be empty in most cases.
|
|
|
|
//
|
|
|
|
// see: https://www.consul.io/docs/connect/proxies/envoy#supported-versions
|
|
|
|
var UnsupportedEnvoyVersions = []string{}
|
|
|
|
|
|
|
|
// GetMaxEnvoyMinorVersion grabs the first value in EnvoyVersions and strips the patch number off in order
|
|
|
|
// to return the maximum supported Envoy minor version
|
|
|
|
// For example, if the input string is "1.14.1", the function would return "1.14".
|
|
|
|
func GetMaxEnvoyMinorVersion() string {
|
|
|
|
s := strings.Split(EnvoyVersions[0], ".")
|
|
|
|
return s[0] + "." + s[1]
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetMinEnvoyMinorVersion grabs the last value in EnvoyVersions and strips the patch number off in order
|
|
|
|
// to return the minimum supported Envoy minor version
|
|
|
|
// For example, if the input string is "1.12.1", the function would return "1.12".
|
|
|
|
func GetMinEnvoyMinorVersion() string {
|
|
|
|
s := strings.Split(EnvoyVersions[len(EnvoyVersions)-1], ".")
|
|
|
|
return s[0] + "." + s[1]
|
|
|
|
}
|