Skip to content

Commit

Permalink
Merge branch 'main' into httproute-controller-add-reference-grant-watch
Browse files Browse the repository at this point in the history
  • Loading branch information
rainest committed Mar 27, 2023
2 parents 3fd408d + 6b00bfa commit 1fccf4d
Show file tree
Hide file tree
Showing 16 changed files with 102 additions and 176 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/backport.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Backport
on:
pull_request_target:
types:
- closed
- labeled

jobs:
backport:
name: Backport
runs-on: ubuntu-latest
# Only react to merged PRs for security reasons.
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
if: >
github.event.pull_request.merged
&& (
github.event.action == 'closed'
|| (
github.event.action == 'labeled'
&& contains(github.event.label.name, 'backport')
)
)
steps:
- uses: tibdex/backport@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ Adding a new version? You'll need three changes:
[#3778](https://github.com/Kong/kubernetes-ingress-controller/pull/3778)
- `HTTPRoute` reconciler now watches relevant `ReferenceGrant`s for changes.
[#3759](https://github.com/Kong/kubernetes-ingress-controller/pull/3759)
- Bumped Kong version in manifests to 3.2.
[#3804](https://github.com/Kong/kubernetes-ingress-controller/pull/3804)

### Fixed

Expand Down
4 changes: 2 additions & 2 deletions config/image/enterprise/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ kind: Component
images:
- name: kong
newName: kong/kong-gateway
newTag: '3.1'
newTag: '3.2'
- name: kong-placeholder
newName: kong/kong-gateway
newTag: '3.1'
newTag: '3.2'
2 changes: 1 addition & 1 deletion config/image/oss/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: Component
images:
- name: kong-placeholder
newName: kong
newTag: '3.1'
newTag: '3.2'
- name: kic-placeholder
newName: kong/kubernetes-ingress-controller
newTag: '2.8.1'
2 changes: 1 addition & 1 deletion deploy/single/all-in-one-dbless-konnect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1781,7 +1781,7 @@ spec:
value: /dev/stderr
- name: KONG_ROUTER_FLAVOR
value: traditional
image: kong:3.1
image: kong:3.2
lifecycle:
preStop:
exec:
Expand Down
2 changes: 1 addition & 1 deletion deploy/single/all-in-one-dbless-legacy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1657,7 +1657,7 @@ spec:
value: /dev/stderr
- name: KONG_ROUTER_FLAVOR
value: traditional
image: kong:3.1
image: kong:3.2
lifecycle:
preStop:
exec:
Expand Down
2 changes: 1 addition & 1 deletion deploy/single/all-in-one-dbless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1766,7 +1766,7 @@ spec:
value: /dev/stderr
- name: KONG_ROUTER_FLAVOR
value: traditional
image: kong:3.1
image: kong:3.2
lifecycle:
preStop:
exec:
Expand Down
8 changes: 4 additions & 4 deletions deploy/single/all-in-one-postgres-enterprise.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1720,7 +1720,7 @@ spec:
value: /dev/stderr
- name: KONG_ROUTER_FLAVOR
value: traditional
image: kong/kong-gateway:3.1
image: kong/kong-gateway:3.2
lifecycle:
preStop:
exec:
Expand Down Expand Up @@ -1839,7 +1839,7 @@ spec:
value: postgres
- name: KONG_PG_PASSWORD
value: kong
image: kong/kong-gateway:3.1
image: kong/kong-gateway:3.2
name: wait-for-migrations
serviceAccountName: kong-serviceaccount
volumes:
Expand Down Expand Up @@ -1938,7 +1938,7 @@ spec:
value: postgres
- name: KONG_PG_PORT
value: "5432"
image: kong/kong-gateway:3.1
image: kong/kong-gateway:3.2
name: kong-migrations
imagePullSecrets:
- name: kong-enterprise-edition-docker
Expand All @@ -1953,7 +1953,7 @@ spec:
value: postgres
- name: KONG_PG_PORT
value: "5432"
image: kong/kong-gateway:3.1
image: kong/kong-gateway:3.2
name: wait-for-postgres
restartPolicy: OnFailure
---
Expand Down
8 changes: 4 additions & 4 deletions deploy/single/all-in-one-postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1675,7 +1675,7 @@ spec:
value: /dev/stderr
- name: KONG_ROUTER_FLAVOR
value: traditional
image: kong:3.1
image: kong:3.2
lifecycle:
preStop:
exec:
Expand Down Expand Up @@ -1776,7 +1776,7 @@ spec:
value: postgres
- name: KONG_PG_PASSWORD
value: kong
image: kong:3.1
image: kong:3.2
name: wait-for-migrations
serviceAccountName: kong-serviceaccount
volumes:
Expand Down Expand Up @@ -1865,7 +1865,7 @@ spec:
value: postgres
- name: KONG_PG_PORT
value: "5432"
image: kong:3.1
image: kong:3.2
name: kong-migrations
initContainers:
- command:
Expand All @@ -1878,7 +1878,7 @@ spec:
value: postgres
- name: KONG_PG_PORT
value: "5432"
image: kong:3.1
image: kong:3.2
name: wait-for-postgres
restartPolicy: OnFailure
---
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/go-logr/logr v1.2.3
github.com/google/go-cmp v0.5.9
github.com/google/uuid v1.3.0
github.com/kong/deck v1.19.0
github.com/kong/deck v1.19.1
github.com/kong/go-kong v0.39.0
github.com/kong/kubernetes-telemetry v0.0.2
github.com/kong/kubernetes-testing-framework v0.30.0
Expand Down Expand Up @@ -113,7 +113,7 @@ require (
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hexops/gotextdiff v1.0.3 // indirect
github.com/huandu/xstrings v1.3.3 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/imdario/mergo v0.3.14 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand Down Expand Up @@ -142,7 +142,7 @@ require (
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/shirou/gopsutil/v3 v3.23.1 // indirect
github.com/shirou/gopsutil/v3 v3.23.2 // indirect
github.com/shopspring/decimal v1.2.0 // indirect
github.com/sourcegraph/conc v0.3.0
github.com/spf13/cast v1.5.0 // indirect
Expand Down
15 changes: 7 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk=
github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg=
github.com/imdario/mergo v0.3.14 h1:fOqeC1+nCuuk6PKQdg9YmosXX7Y7mHX6R/0ZldI9iHo=
github.com/imdario/mergo v0.3.14/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc=
github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
Expand Down Expand Up @@ -503,8 +503,8 @@ github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQL
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
github.com/kong/deck v1.19.0 h1:6lnDeLtgSBCTcvTZE58gKlDJeEZUOugxcuy9V958r5I=
github.com/kong/deck v1.19.0/go.mod h1:yHCu0ZNER3bEE1b88z8bPlEqt8YSxd1XrM3aYz1gAEc=
github.com/kong/deck v1.19.1 h1:sCO7Raf5vNneQbAIhPXL+UPJ+7SNG3xQOoQefFAi7D8=
github.com/kong/deck v1.19.1/go.mod h1:FQkU8gw3eBIhoJQauzpsRzcFNLezs8zAOZHn3xy7fhc=
github.com/kong/go-kong v0.39.0 h1:fAtZXpM7RVYukBu7Mu6RvRpklZOfXBXUs06NlDY5yXg=
github.com/kong/go-kong v0.39.0/go.mod h1:QHn1QBxwbtGBR+F2S5y49m/fEMmYeYAHeNCP+iGGBBk=
github.com/kong/kubernetes-telemetry v0.0.2 h1:ZLoctQzvo0onCxbMgFMGsIGu6qAXWaMrd4o5Rv//C68=
Expand Down Expand Up @@ -699,8 +699,8 @@ github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
github.com/sethvargo/go-password v0.2.0 h1:BTDl4CC/gjf/axHMaDQtw507ogrXLci6XRiLc7i/UHI=
github.com/sethvargo/go-password v0.2.0/go.mod h1:Ym4Mr9JXLBycr02MFuVQ/0JHidNetSgbzutTr3zsYXE=
github.com/shirou/gopsutil/v3 v3.23.1 h1:a9KKO+kGLKEvcPIs4W62v0nu3sciVDOOOPUD0Hz7z/4=
github.com/shirou/gopsutil/v3 v3.23.1/go.mod h1:NN6mnm5/0k8jw4cBfCnJtr5L7ErOTg18tMNpgFkn0hA=
github.com/shirou/gopsutil/v3 v3.23.2 h1:PAWSuiAszn7IhPMBtXsbSCafej7PqUOvY6YywlQUExU=
github.com/shirou/gopsutil/v3 v3.23.2/go.mod h1:gv0aQw33GLo3pG8SiWKiQrbDzbRY1K80RyZJ7V4Th1M=
github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
Expand Down Expand Up @@ -1078,7 +1078,7 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
Expand Down Expand Up @@ -1365,7 +1365,6 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
Expand Down
10 changes: 1 addition & 9 deletions test/integration/consumer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,5 @@ func TestConsumerCredential(t *testing.T) {

t.Log("deleting Ingress and waiting for routes to be torn down")
require.NoError(t, clusters.DeleteIngress(ctx, env.Cluster(), ns.Name, ingress))
assert.Eventually(t, func() bool {
resp, err := helpers.DefaultHTTPClient().Get(fmt.Sprintf("%s/test_plugin_essentials", proxyURL))
if err != nil {
t.Logf("WARNING: error while waiting for %s: %v", proxyURL, err)
return false
}
defer resp.Body.Close()
return helpers.ExpectHTTP404WithNoRoute(t, proxyURL, resp)
}, ingressWait, waitTick)
helpers.EventuallyExpectHTTP404WithNoRoute(t, proxyURL, "/test_plugin_essentials", ingressWait, waitTick, nil)
}
92 changes: 24 additions & 68 deletions test/integration/ingress_regex_match_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package integration

import (
"bytes"
"context"
"fmt"
"net/http"
Expand Down Expand Up @@ -137,43 +136,12 @@ func TestIngressRegexMatchPath(t *testing.T) {
}()

t.Log("testing paths expected to match")
notMatchedPaths := []string{}
require.Eventually(t, func() bool {
notMatchedPaths = []string{}
for _, path := range tc.matchPaths {
resp, err := helpers.DefaultHTTPClient().Get(fmt.Sprintf("%s%s", proxyURL, path))
if err != nil {
t.Logf("WARNING: error while waiting for %s: %v", proxyURL, err)
notMatchedPaths = append(notMatchedPaths, path)
return false
}
defer resp.Body.Close()
// returns false if one path is not matched.
if resp.StatusCode == http.StatusOK {
b := new(bytes.Buffer)
n, err := b.ReadFrom(resp.Body)
require.NoError(t, err)
require.True(t, n > 0)
if !strings.Contains(b.String(), "<title>httpbin.org</title>") {
notMatchedPaths = append(notMatchedPaths, path)
return false
}
} else {
notMatchedPaths = append(notMatchedPaths, path)
return false
}
}
// returns true if all testing paths matched.
return true
}, ingressWait, waitTick,
fmt.Sprintf("paths %v not matched %s", notMatchedPaths, tc.description))

for _, path := range tc.matchPaths {
helpers.EventuallyGETPath(t, proxyURL, path, http.StatusOK, "<title>httpbin.org</title>", nil, ingressWait, waitTick)
}
t.Log("testing paths expected not to match")
for _, path := range tc.notMatchPaths {
resp, err := helpers.DefaultHTTPClient().Get(fmt.Sprintf("%s%s", proxyURL, path))
require.NoError(t, err)
defer resp.Body.Close()
require.Equalf(t, http.StatusNotFound, resp.StatusCode, "should not match path %s: %s", path, tc.description)
helpers.EventuallyExpectHTTP404WithNoRoute(t, proxyURL, path, ingressWait, waitTick, nil)
}
})
}
Expand Down Expand Up @@ -266,41 +234,29 @@ func TestIngressRegexMatchHeader(t *testing.T) {
}()

t.Log("testing headers expected to match")
require.Eventually(t, func() bool {
for _, header := range tc.matchHeaders {
req := helpers.MustHTTPRequest(t, "GET", proxyURL, "/", nil)
req.Header.Add(matchHeaderKey, header)
resp, err := helpers.DefaultHTTPClient().Do(req)
if err != nil {
t.Logf("WARNING: error while waiting for %s: %v", proxyURL, err)
return false
}
defer resp.Body.Close()
// returns false if one of test requests is not matched.
if resp.StatusCode == http.StatusOK {
b := new(bytes.Buffer)
n, err := b.ReadFrom(resp.Body)
require.NoError(t, err)
require.True(t, n > 0)
if !strings.Contains(b.String(), "<title>httpbin.org</title>") {
return false
}
} else {
return false
}
}
// returns true if all testing requests matched.
return true
}, ingressWait, waitTick)
for _, header := range tc.matchHeaders {
helpers.EventuallyGETPath(
t,
proxyURL,
"/",
http.StatusOK,
"<title>httpbin.org</title>",
map[string]string{matchHeaderKey: header},
ingressWait,
waitTick,
)
}

t.Log("testing headers expected not to match")
for _, header := range tc.notMatchHeaders {
req := helpers.MustHTTPRequest(t, "GET", proxyURL, "/", nil)
req.Header.Add(matchHeaderKey, header)
resp, err := helpers.DefaultHTTPClient().Do(req)
require.NoError(t, err)
defer resp.Body.Close()
require.Equalf(t, http.StatusNotFound, resp.StatusCode, "should not match host %s", header)
helpers.EventuallyExpectHTTP404WithNoRoute(
t,
proxyURL,
"/",
ingressWait,
waitTick,
map[string]string{matchHeaderKey: header},
)
}
})
}
Expand Down

0 comments on commit 1fccf4d

Please sign in to comment.