forked from kgateway-dev/kgateway
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathfederation.go
33 lines (26 loc) · 874 Bytes
/
federation.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package version
import (
"math"
"github.com/solo-io/go-utils/versionutils"
"github.com/solo-io/go-utils/versionutils/git"
)
const GlooFedHelmRepoIndex = "https://storage.googleapis.com/gloo-fed-helm/index.yaml"
const GlooFed = "gloo-fed"
// The version of GlooE installed by the CLI.
// Calculated from the largest semver gloo-ee version in the helm repo index
func GetLatestGlooFedVersion(stableOnly bool) (string, error) {
maxVersion := &versionutils.Version{
Major: math.MaxInt32,
Minor: math.MaxInt32,
Patch: math.MaxInt32,
}
if Version != UndefinedVersion {
version, err := versionutils.ParseVersion(git.AppendTagPrefix(Version))
if err != nil {
return "", err
}
maxVersion.Major = version.Major
maxVersion.Minor = version.Minor
}
return GetLatestHelmChartVersionWithMaxVersion(GlooFedHelmRepoIndex, GlooFed, stableOnly, maxVersion)
}