INNER CODE UNIT · Go
getCurrentEnvoyVersion
projectcontour/contour · hack/actions/bump-envoy-version/main.go:88
func getCurrentEnvoyVersion() string {
content, err := os.ReadFile("examples/contour/03-envoy.yaml")
if err != nil {
log.WithError(err).Fatal("Failed to determine current version")
}
envoyImageRe := regexp.MustCompile(`docker\.io/envoyproxy/envoy:(distroless-)?v([0-9]+\.[0-9]+\.[0-9]+)`)
matches := envoyImageRe.FindStringSubmatch(string(content))
if len(matches) < 3 {
log.Fatal("Failed to match current version in examples/contour/03-envoy.yaml")
}
return matches[1] + "v" + matches[2]
}
func getLatestEnvoyVersion(track string) string {
resp, err := http.Get("https://api.github.com/repos/envoyproxy/envoy/releases")
if err != nil {