From a92d75acc9689dd12a9183a524c58261e23b5326 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Ma=C5=82ek?= Date: Wed, 15 Feb 2023 09:57:23 +0100 Subject: [PATCH] chore: bump default enterprise gateway image to 3.1.1.3 --- pkg/clusters/addons/kong/addon.go | 2 +- test/integration/enterprise_test.go | 54 ++++++++++++++++------------- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/pkg/clusters/addons/kong/addon.go b/pkg/clusters/addons/kong/addon.go index e5365882e..c2af6e79a 100644 --- a/pkg/clusters/addons/kong/addon.go +++ b/pkg/clusters/addons/kong/addon.go @@ -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 diff --git a/test/integration/enterprise_test.go b/test/integration/enterprise_test.go index 620dd0e7f..2ede206b6 100644 --- a/test/integration/enterprise_test.go +++ b/test/integration/enterprise_test.go @@ -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" @@ -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" @@ -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 {