From c518cbeaead3aad49e3aefe250a7acf23ec28e31 Mon Sep 17 00:00:00 2001 From: Herve Date: Thu, 12 Oct 2023 10:06:41 +0200 Subject: [PATCH 01/10] Remove route buffer --- .github/workflows/build.yml | 7 +++-- kong/resource_kong_route.go | 52 ++++++++++++++++---------------- kong/resource_kong_route_test.go | 16 +++++----- 3 files changed, 39 insertions(+), 36 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9b735ce..4940481 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,11 @@ name: gokong build on: push: - branches: [ master ] - pull_request: + branches: + - develop + - stage + - master + jobs: build: name: building gokong diff --git a/kong/resource_kong_route.go b/kong/resource_kong_route.go index 046a0d8..5bedeb0 100644 --- a/kong/resource_kong_route.go +++ b/kong/resource_kong_route.go @@ -122,18 +122,18 @@ func resourceKongRoute() *schema.Resource { ForceNew: false, Default: 426, }, - "request_buffering": { - Type: schema.TypeBool, - Optional: true, - ForceNew: false, - Default: true, - }, - "response_buffering": { - Type: schema.TypeBool, - Optional: true, - ForceNew: false, - Default: true, - }, + // "request_buffering": { + // Type: schema.TypeBool, + // Optional: true, + // ForceNew: false, + // Default: true, + // }, + // "response_buffering": { + // Type: schema.TypeBool, + // Optional: true, + // ForceNew: false, + // Default: true, + // }, "tags": { Type: schema.TypeList, Optional: true, @@ -304,19 +304,19 @@ func resourceKongRouteRead(ctx context.Context, d *schema.ResourceData, meta int } } - if route.RequestBuffering != nil { - err := d.Set("request_buffering", route.RequestBuffering) - if err != nil { - return diag.FromErr(err) - } - } + // if route.RequestBuffering != nil { + // err := d.Set("request_buffering", route.RequestBuffering) + // if err != nil { + // return diag.FromErr(err) + // } + // } - if route.ResponseBuffering != nil { - err := d.Set("response_buffering", route.ResponseBuffering) - if err != nil { - return diag.FromErr(err) - } - } + // if route.ResponseBuffering != nil { + // err := d.Set("response_buffering", route.ResponseBuffering) + // if err != nil { + // return diag.FromErr(err) + // } + // } err = d.Set("tags", route.Tags) if err != nil { @@ -373,8 +373,8 @@ func createKongRouteRequestFromResourceData(d *schema.ResourceData) *kong.Route }, PathHandling: readStringPtrFromResource(d, "path_handling"), HTTPSRedirectStatusCode: readIntPtrFromResource(d, "https_redirect_status_code"), - RequestBuffering: readBoolPtrFromResource(d, "request_buffering"), - ResponseBuffering: readBoolPtrFromResource(d, "response_buffering"), + // RequestBuffering: readBoolPtrFromResource(d, "request_buffering"), + // ResponseBuffering: readBoolPtrFromResource(d, "response_buffering"), Tags: readStringArrayPtrFromResource(d, "tags"), Headers: readMapStringArrayFromResource(d, "header"), } diff --git a/kong/resource_kong_route_test.go b/kong/resource_kong_route_test.go index 736d90d..da72b65 100644 --- a/kong/resource_kong_route_test.go +++ b/kong/resource_kong_route_test.go @@ -33,8 +33,8 @@ func TestAccKongRoute(t *testing.T) { resource.TestCheckResourceAttr("kong_route.route", "regex_priority", "1"), resource.TestCheckResourceAttr("kong_route.route", "path_handling", "v1"), resource.TestCheckResourceAttr("kong_route.route", "https_redirect_status_code", "301"), - resource.TestCheckResourceAttr("kong_route.route", "request_buffering", "false"), - resource.TestCheckResourceAttr("kong_route.route", "response_buffering", "false"), + // resource.TestCheckResourceAttr("kong_route.route", "request_buffering", "false"), + // resource.TestCheckResourceAttr("kong_route.route", "response_buffering", "false"), resource.TestCheckResourceAttr("kong_route.route", "header.#", "2"), resource.TestCheckResourceAttr("kong_route.route", "header.0.name", "x-test-1"), resource.TestCheckResourceAttr("kong_route.route", "header.0.values.#", "2"), @@ -66,8 +66,8 @@ func TestAccKongRoute(t *testing.T) { resource.TestCheckResourceAttr("kong_route.route", "regex_priority", "2"), resource.TestCheckResourceAttr("kong_route.route", "path_handling", "v0"), resource.TestCheckResourceAttr("kong_route.route", "https_redirect_status_code", "426"), - resource.TestCheckResourceAttr("kong_route.route", "request_buffering", "true"), - resource.TestCheckResourceAttr("kong_route.route", "response_buffering", "true"), + // resource.TestCheckResourceAttr("kong_route.route", "request_buffering", "true"), + // resource.TestCheckResourceAttr("kong_route.route", "response_buffering", "true"), resource.TestCheckResourceAttr("kong_route.route", "header.#", "1"), resource.TestCheckResourceAttr("kong_route.route", "header.0.name", "x-test-1"), resource.TestCheckResourceAttr("kong_route.route", "header.0.values.#", "1"), @@ -216,8 +216,8 @@ resource "kong_route" "route" { service_id = "${kong_service.service.id}" path_handling = "v1" https_redirect_status_code = 301 - request_buffering = false - response_buffering = false + // request_buffering = false + // response_buffering = false header { name = "x-test-1" values = ["a", "b"] @@ -248,8 +248,8 @@ resource "kong_route" "route" { service_id = "${kong_service.service.id}" path_handling = "v0" https_redirect_status_code = 426 - request_buffering = true - response_buffering = true + // request_buffering = true + // response_buffering = true header { name = "x-test-1" values = ["a"] From ce7fcd4e80137d585213ac2bb2a40b7f5c74ec5d Mon Sep 17 00:00:00 2001 From: Herve Date: Thu, 12 Oct 2023 10:14:11 +0200 Subject: [PATCH 02/10] Add release --- .github/workflows/release.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 05d13a5..ab8aca3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,8 +12,10 @@ name: release on: push: - tags: - - 'v*' + branches: + - develop + - stage + - master jobs: goreleaser: runs-on: ubuntu-latest From 38f757ad7210611a87806f39b99eec197b10df47 Mon Sep 17 00:00:00 2001 From: Herve Date: Thu, 12 Oct 2023 14:19:34 +0200 Subject: [PATCH 03/10] Check GPG release action --- .github/workflows/release.yml | 43 ++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ab8aca3..be6db4f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ on: - stage - master jobs: - goreleaser: + build: runs-on: ubuntu-latest steps: - @@ -31,21 +31,38 @@ jobs: uses: actions/setup-go@v2 with: go-version: 1.16 + # - + # name: Import GPG key + # id: import_gpg + # uses: hashicorp/ghaction-import-gpg@v2.1.0 + # env: + # # These secrets will need to be configured for the repository: + # GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + # PASSPHRASE: ${{ secrets.PASSPHRASE }} - name: Import GPG key id: import_gpg - uses: hashicorp/ghaction-import-gpg@v2.1.0 + uses: crazy-max/ghaction-import-gpg@v6 env: - # These secrets will need to be configured for the repository: GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} PASSPHRASE: ${{ secrets.PASSPHRASE }} - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2.5.0 - with: - version: latest - args: release --rm-dist - env: - GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} - # GitHub sets this automatically - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - + # name: Run GoReleaser + # uses: goreleaser/goreleaser-action@v2.5.0 + # with: + # version: latest + # args: release --rm-dist + # env: + # GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} + # # GitHub sets this automatically + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - + # name: Builder + # uses: wangyoucao577/go-release-action@v1.33 + # with: + # github_token: ${{ secrets.GH_ASSET_TOKEN }} + # goos: linux + # goarch: amd64 + # project_path: "cmd" + # asset_name: renymize-linux-amd64 + # goversion: 1.19 \ No newline at end of file From 98435dd6065f49cdf2eb6dfb99e59e6c6d592585 Mon Sep 17 00:00:00 2001 From: Herve Date: Thu, 12 Oct 2023 14:30:53 +0200 Subject: [PATCH 04/10] Check GPG release action --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index be6db4f..16764dd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,7 +44,7 @@ jobs: id: import_gpg uses: crazy-max/ghaction-import-gpg@v6 env: - GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + # GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} PASSPHRASE: ${{ secrets.PASSPHRASE }} # - # name: Run GoReleaser From e8cb075d13cf154e503feb1b28453f6ca8159d9e Mon Sep 17 00:00:00 2001 From: Herve Date: Thu, 12 Oct 2023 14:32:42 +0200 Subject: [PATCH 05/10] Check GPG release action --- .github/workflows/release.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 16764dd..b972606 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,9 +43,13 @@ jobs: name: Import GPG key id: import_gpg uses: crazy-max/ghaction-import-gpg@v6 - env: - # GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + with: + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} PASSPHRASE: ${{ secrets.PASSPHRASE }} + + - + name: List keys + run: gpg -K # - # name: Run GoReleaser # uses: goreleaser/goreleaser-action@v2.5.0 From e639a39794646d3202a4936dbe41538924dd3fb2 Mon Sep 17 00:00:00 2001 From: Herve Date: Thu, 12 Oct 2023 14:34:30 +0200 Subject: [PATCH 06/10] Set builder --- .github/workflows/release.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b972606..add477c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -60,13 +60,13 @@ jobs: # GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} # # GitHub sets this automatically # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - - # name: Builder - # uses: wangyoucao577/go-release-action@v1.33 - # with: - # github_token: ${{ secrets.GH_ASSET_TOKEN }} - # goos: linux - # goarch: amd64 - # project_path: "cmd" - # asset_name: renymize-linux-amd64 - # goversion: 1.19 \ No newline at end of file + - + name: Builder + uses: wangyoucao577/go-release-action@v1.33 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + goos: linux + goarch: amd64 + project_path: "cmd" + asset_name: renymize-linux-amd64 + goversion: 1.19 \ No newline at end of file From f0e70a19c2ffe5d420191a6d8d5f144e8b4e8f05 Mon Sep 17 00:00:00 2001 From: Herve Date: Thu, 12 Oct 2023 14:40:24 +0200 Subject: [PATCH 07/10] Set builder --- .github/workflows/release.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index add477c..427bbbf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,14 +23,7 @@ jobs: - name: Checkout uses: actions/checkout@v2.3.4 - - - name: Unshallow - run: git fetch --prune --unshallow - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.16 + # - # name: Import GPG key # id: import_gpg @@ -47,9 +40,6 @@ jobs: GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} PASSPHRASE: ${{ secrets.PASSPHRASE }} - - - name: List keys - run: gpg -K # - # name: Run GoReleaser # uses: goreleaser/goreleaser-action@v2.5.0 From 9b0ee5dbcfb0846d9ff9bd1dad6637ed57ea9bb8 Mon Sep 17 00:00:00 2001 From: Herve Date: Thu, 12 Oct 2023 14:46:45 +0200 Subject: [PATCH 08/10] Set builder GoRelease --- .github/workflows/release.yml | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 427bbbf..218b34b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,23 +40,23 @@ jobs: GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} PASSPHRASE: ${{ secrets.PASSPHRASE }} - # - - # name: Run GoReleaser - # uses: goreleaser/goreleaser-action@v2.5.0 - # with: - # version: latest - # args: release --rm-dist - # env: - # GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} - # # GitHub sets this automatically - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Builder - uses: wangyoucao577/go-release-action@v1.33 + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2.5.0 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - goos: linux - goarch: amd64 - project_path: "cmd" - asset_name: renymize-linux-amd64 - goversion: 1.19 \ No newline at end of file + version: latest + args: release --rm-dist + env: + GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} + # GitHub sets this automatically + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - + # name: Builder + # uses: wangyoucao577/go-release-action@v1.33 + # with: + # github_token: ${{ secrets.GITHUB_TOKEN }} + # goos: linux + # goarch: amd64 + # project_path: "cmd" + # asset_name: renymize-linux-amd64 + # goversion: 1.19 \ No newline at end of file From 29bbea2240222e55c386174350f9d90be9fb512d Mon Sep 17 00:00:00 2001 From: Herve Date: Thu, 12 Oct 2023 16:25:01 +0200 Subject: [PATCH 09/10] Set builder tag --- .github/workflows/release.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 218b34b..3351e19 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,10 +12,8 @@ name: release on: push: - branches: - - develop - - stage - - master + tags: + - 'v*' jobs: build: runs-on: ubuntu-latest From 055176684cf3459caec7c8b9ace23ded2394786a Mon Sep 17 00:00:00 2001 From: Herve Date: Thu, 12 Oct 2023 17:58:06 +0200 Subject: [PATCH 10/10] Clean GitHub release --- .github/workflows/release.yml | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3351e19..7442bcf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,14 +22,6 @@ jobs: name: Checkout uses: actions/checkout@v2.3.4 - # - - # name: Import GPG key - # id: import_gpg - # uses: hashicorp/ghaction-import-gpg@v2.1.0 - # env: - # # These secrets will need to be configured for the repository: - # GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - # PASSPHRASE: ${{ secrets.PASSPHRASE }} - name: Import GPG key id: import_gpg @@ -47,14 +39,4 @@ jobs: env: GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} # GitHub sets this automatically - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - - # name: Builder - # uses: wangyoucao577/go-release-action@v1.33 - # with: - # github_token: ${{ secrets.GITHUB_TOKEN }} - # goos: linux - # goarch: amd64 - # project_path: "cmd" - # asset_name: renymize-linux-amd64 - # goversion: 1.19 \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file