Skip to content

Commit

Permalink
fix(*) support enterprise versions (#61)
Browse files Browse the repository at this point in the history
* fix(*) support enterprise versions
  • Loading branch information
subnetmarco authored Jun 2, 2018
1 parent 21283df commit 12cb958
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ all: all-container
BUILDTAGS=

# Use the 0.0 tag for testing, it shouldn't clobber any release builds
TAG?=0.0.4
TAG?=0.0.5
REGISTRY?=kong-docker-kubernetes-ingress-controller.bintray.io
GOOS?=linux
DOCKER?=docker
Expand Down
4 changes: 2 additions & 2 deletions cli/ingress-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ func main() {
glog.Fatalf("%v", err)
}

if !v.GTE(semver.MustParse("0.13.0")) {
glog.Fatalf("The version %s is not compatible with the Kong Ingress Controller. It requires Kong 0.13.0 or higher.", v)
if !(v.GTE(semver.MustParse("0.13.0")) || v.GTE(semver.MustParse("0.32.0"))) {
glog.Fatalf("The version %s is not compatible with the Kong Ingress Controller. It requires Kong CE 0.13.0 or higher, or Kong EE 0.32 or higher.", v)
}

glog.Infof("kong version: %s", v)
Expand Down
9 changes: 8 additions & 1 deletion internal/apis/admin/kong_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,15 @@ func (c *RestClient) GetVersion() (semver.Version, error) {

if version, ok := info["version"]; ok {
v := version.(string)

// fix enterprise edition semver adding patch number
re := regexp.MustCompile(`([\d\.]+)-enterprise-edition`)
if re.MatchString(v) {
v = re.ReplaceAllString(v, "$1.0-enterprise")
}

// fix bad version formats like 0.13.0preview1
re := regexp.MustCompile(`(.*\d)(preview.*|rc.*)`)
re = regexp.MustCompile(`(.*\d)(preview.*|rc.*)`)
if re.MatchString(v) {
v = re.ReplaceAllString(v, "$1-$2")
}
Expand Down
2 changes: 1 addition & 1 deletion vendor/k8s.io/client-go/discovery/discovery_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 39 additions & 5 deletions vendor/k8s.io/client-go/discovery/discovery_client_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions vendor/k8s.io/client-go/transport/cache.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 12 additions & 5 deletions vendor/k8s.io/client-go/transport/cache_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/k8s.io/client-go/transport/transport.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions vendor/k8s.io/client-go/transport/transport_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 12cb958

Please sign in to comment.