ebed9e048f
* add functions for returning the max and min Envoy major versions - added an UnsupportedEnvoyVersions list - removed an unused error from TestDetermineSupportedProxyFeaturesFromString - modified minSupportedVersion to use the function for getting the Min Envoy major version. Using just the major version without the patch is equivalent to using `.0` * added a function for executing the envoy --version command - added a new exec.go file to not be locked to unix system * added envoy version check when using consul connect envoy * added changelog entry * added docs change
42 lines
1.6 KiB
Go
42 lines
1.6 KiB
Go
package proxysupport
|
|
|
|
import "strings"
|
|
|
|
// EnvoyVersions lists the latest officially supported versions of envoy.
|
|
//
|
|
// This list must be sorted by semver descending. Only one point release for
|
|
// each major release should be present.
|
|
//
|
|
// see: https://www.consul.io/docs/connect/proxies/envoy#supported-versions
|
|
var EnvoyVersions = []string{
|
|
"1.24.0",
|
|
"1.23.2",
|
|
"1.22.5",
|
|
"1.21.5",
|
|
}
|
|
|
|
// 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]
|
|
}
|