Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #1

Merged
merged 10 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: gokong build
on:
push:
branches: [ master ]
pull_request:
branches:
- develop
- stage
- master

jobs:
build:
name: building gokong
Expand Down
19 changes: 6 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,21 @@ on:
tags:
- 'v*'
jobs:
goreleaser:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/[email protected]
-
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
uses: hashicorp/[email protected]
env:
# These secrets will need to be configured for the repository:
uses: crazy-max/ghaction-import-gpg@v6
with:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}

-
name: Run GoReleaser
uses: goreleaser/[email protected]
Expand All @@ -46,4 +39,4 @@ jobs:
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
# GitHub sets this automatically
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52 changes: 26 additions & 26 deletions kong/resource_kong_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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"),
}
Expand Down
16 changes: 8 additions & 8 deletions kong/resource_kong_route_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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"),
Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -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"]
Expand Down
Loading