From 75e69ff9bc3952435d979cded0b1f716fa04af61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Burzy=C5=84ski?= Date: Wed, 20 Dec 2023 13:55:51 +0100 Subject: [PATCH] chore: specify GKE release channel for E2E tests (#5371) --- .github/workflows/_e2e_tests.yaml | 1 + go.mod | 4 ++-- go.sum | 12 ++++++------ test/e2e/helpers_test.go | 3 +++ test/internal/testenv/testenv.go | 6 ++++++ 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/_e2e_tests.yaml b/.github/workflows/_e2e_tests.yaml index 47b5dcac67..936ab9d3b9 100644 --- a/.github/workflows/_e2e_tests.yaml +++ b/.github/workflows/_e2e_tests.yaml @@ -273,6 +273,7 @@ jobs: GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} GOOGLE_PROJECT: ${{ secrets.GOOGLE_PROJECT }} GOOGLE_LOCATION: ${{ secrets.GOOGLE_LOCATION }} + TEST_GKE_CLUSTER_RELEASE_CHANNEL: "rapid" - name: upload diagnostics if: ${{ always() }} diff --git a/go.mod b/go.mod index 9db6445092..e1adc1e112 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,7 @@ require ( github.com/kong/go-database-reconciler v1.1.0 github.com/kong/go-kong v0.48.0 github.com/kong/kubernetes-telemetry v0.1.3 - github.com/kong/kubernetes-testing-framework v0.42.0 + github.com/kong/kubernetes-testing-framework v0.43.0 github.com/lithammer/dedent v1.1.0 github.com/miekg/dns v1.1.57 github.com/mitchellh/mapstructure v1.5.0 @@ -185,7 +185,7 @@ require ( github.com/shirou/gopsutil/v3 v3.23.10 // indirect github.com/shopspring/decimal v1.2.0 // indirect github.com/sourcegraph/conc v0.3.0 - github.com/spf13/cast v1.5.1 // indirect + github.com/spf13/cast v1.6.0 // indirect github.com/ssgelm/cookiejarparser v1.0.1 // indirect github.com/tidwall/gjson v1.17.0 github.com/tidwall/match v1.1.1 // indirect diff --git a/go.sum b/go.sum index 6db18f25f5..d368121e18 100644 --- a/go.sum +++ b/go.sum @@ -109,8 +109,8 @@ github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= -github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= @@ -258,8 +258,8 @@ github.com/kong/go-kong v0.48.0 h1:vK1OpoxO50qlKdwPfmx9ChvkTKRsoCCB3b3iHo1umLc= github.com/kong/go-kong v0.48.0/go.mod h1:qH4CEFqT83ywmu1TlMZX09clQH4B8/dX88CtT/jdv/E= github.com/kong/kubernetes-telemetry v0.1.3 h1:Hz2tkHGIIUqbn1x46QRDmmNjbEtJyxyOvHSPne3uPto= github.com/kong/kubernetes-telemetry v0.1.3/go.mod h1:wB7o8dOKa5R396CyiU0sPa8am/g3c5DKd/qrn/Vmb+k= -github.com/kong/kubernetes-testing-framework v0.42.0 h1:ykkgJujEw/O8PqsfEJVCrytWaWDCsVeXGPItSO4pNT0= -github.com/kong/kubernetes-testing-framework v0.42.0/go.mod h1:FWSlK73D1cfNLVy44ug66GPfI2ibc4NrRd8xrsZxUTY= +github.com/kong/kubernetes-testing-framework v0.43.0 h1:Pjh4NMlwApFqi9RPW5NPHD3mOCA62pHKLLX4pWnHGXw= +github.com/kong/kubernetes-testing-framework v0.43.0/go.mod h1:O8Zw6cvWKOS5oVUqh8SEFCX83VywKPx35kleUbeCAwc= github.com/kong/semver/v4 v4.0.1 h1:DIcNR8W3gfx0KabFBADPalxxsp+q/5COwIFkkhrFQ2Y= github.com/kong/semver/v4 v4.0.1/go.mod h1:LImQ0oT15pJvSns/hs2laLca2zcYoHu5EsSNY0J6/QA= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -399,8 +399,8 @@ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVs github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= diff --git a/test/e2e/helpers_test.go b/test/e2e/helpers_test.go index a1635fd5b2..56092a2ba2 100644 --- a/test/e2e/helpers_test.go +++ b/test/e2e/helpers_test.go @@ -228,6 +228,9 @@ func createGKEBuilder(t *testing.T) (*environments.Builder, error) { t.Logf("creating GKE cluster, with requested version: %s", k8sVersion) clusterBuilder.WithClusterVersion(k8sVersion) } + if ch := testenv.GKEClusterReleaseChannel(); ch != "" { + clusterBuilder.WithReleaseChannel(gke.ReleaseChannel(ch)) + } return environments.NewBuilder().WithClusterBuilder(clusterBuilder), nil } diff --git a/test/internal/testenv/testenv.go b/test/internal/testenv/testenv.go index 7a8baa1a48..812c5f31f4 100644 --- a/test/internal/testenv/testenv.go +++ b/test/internal/testenv/testenv.go @@ -166,6 +166,12 @@ func ClusterVersion() string { return os.Getenv("KONG_CLUSTER_VERSION") } +// GKEClusterReleaseChannel indicates the GKE cluster release channel to use when +// creating a GKE cluster in tests. +func GKEClusterReleaseChannel() string { + return os.Getenv("TEST_GKE_CLUSTER_RELEASE_CHANNEL") +} + // ClusterProvider indicates the Kubernetes cluster provider. func ClusterProvider() string { return os.Getenv("KONG_CLUSTER_PROVIDER")