Skip to content

Commit

Permalink
chore: bump default enterprise gateway image to 3.1.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalek committed Feb 15, 2023
1 parent 61558b0 commit a92d75a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 25 deletions.
2 changes: 1 addition & 1 deletion pkg/clusters/addons/kong/addon.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const (
DefaultEnterpriseImageRepo = "kong/kong-gateway"

// DefaultEnterpriseImageTag latest kong enterprise image tag
DefaultEnterpriseImageTag = "2.7.0.0-alpine"
DefaultEnterpriseImageTag = "3.1.1.3-alpine"

// DefaultEnterpriseLicenseSecretName is the name that will be used by default for the
// Kubernetes secret containing the Kong enterprise license that will be
Expand Down
54 changes: 30 additions & 24 deletions test/integration/enterprise_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"testing"
"time"

gokong "github.com/kong/go-kong/kong"
"github.com/sethvargo/go-password/password"
"github.com/stretchr/testify/require"

Expand Down Expand Up @@ -70,30 +71,34 @@ func TestKongEnterprisePostgres(t *testing.T) {
require.NoError(t, err)
req.Header.Set("Kong-Admin-Token", adminPassword)

t.Log("pulling the admin api information")
httpc := http.Client{Timeout: time.Second * 10}
var body []byte
require.Eventually(t, func() bool {
resp, err := httpc.Do(req)
if err != nil {
return false
}
defer resp.Body.Close()
body, err = io.ReadAll(resp.Body)
if err != nil {
return false
}
t.Logf("RESPONSE CODE: %d STATUS: %s", resp.StatusCode, resp.Status)
return resp.StatusCode == http.StatusOK
}, time.Minute, time.Second)

t.Log("verifying the admin api version is enterprise")
adminOutput := struct {
Version string `json:"version"`
}{}
require.NoError(t, json.Unmarshal(body, &adminOutput))
t.Logf("admin output: %+v", &adminOutput)
require.True(t, strings.Contains(adminOutput.Version, "enterprise-edition"))
t.Run("verifying the admin api version is enterprise", func(t *testing.T) {
t.Log("pulling the admin api information")
httpc := http.Client{Timeout: time.Second * 10}
var body []byte
require.Eventually(t, func() bool {
resp, err := httpc.Do(req)
if err != nil {
return false
}
defer resp.Body.Close()
body, err = io.ReadAll(resp.Body)
if err != nil {
return false
}
t.Logf("RESPONSE CODE: %d STATUS: %s", resp.StatusCode, resp.Status)
return resp.StatusCode == http.StatusOK
}, time.Minute, time.Second)

adminOutput := struct {
Version string `json:"version"`
}{}
require.NoError(t, json.Unmarshal(body, &adminOutput))
v, err := gokong.NewVersion(adminOutput.Version)
require.NoError(t, err)

t.Logf("admin api version %s", v)
require.Truef(t, v.IsKongGatewayEnterprise(), "version %s should be an enterprise version but wasn't", v)
})

t.Log("verifying enterprise workspace API functionality")
workspaceEnabledProxyURL := adminURL.String() + "/workspaces"
Expand All @@ -118,6 +123,7 @@ func TestKongEnterprisePostgres(t *testing.T) {
require.NoError(t, <-env.WaitForReady(ctx))

t.Log("accessing httpbin via ingress to validate that the kong proxy is functioning")
httpc := http.Client{Timeout: time.Second * 10}
require.Eventually(t, func() bool {
resp, err := httpc.Get(fmt.Sprintf("%s/%s", proxyURL, httpbinAddon.Path()))
if err != nil {
Expand Down

0 comments on commit a92d75a

Please sign in to comment.