bcgov / gwa-cli

Apache License 2.0
6 stars 1 forks source link

kong-httpbin template does not work with `gwa apply` #105

Closed rustyjux closed 5 months ago

rustyjux commented 6 months ago

Need to add kind: GatewayService and remove one level of indentation.

That is, turn:

services:
  - name: testabc199-dev
    tags: [ ns.gw-abc123 ]
    host: httpbin.org
    port: 443
    protocol: https
    retries: 0
    routes:
      - name: testabc199-dev
        tags: [ ns.gw-abc123 ]
        hosts:
        - testabc19.dev.api.gov.bc.ca
        paths:
        - /
        methods:
        - GET
        strip_path: true
        https_redirect_status_code: 426
        path_handling: v0
        request_buffering: true
        response_buffering: true

into:

kind: GatewayService
name: testabc199-dev
tags: [ ns.gw-abc123 ]
host: httpbin.org
port: 443
protocol: https
retries: 0
routes:
  - name: testabc199-dev
    tags: [ ns.gw-abc123 ]
    hosts:
    - testabc19.dev.api.gov.bc.ca
    paths:
    - /
    methods:
    - GET
    strip_path: true
    https_redirect_status_code: 426
    path_handling: v0
    request_buffering: true
    response_buffering: true
ikethecoder commented 5 months ago

I ran the following test but getting an error when trying to publish so not able to validate:

gwa generate-config --template kong-httpbin --service ajc-httpbin-reg --upstream httpbin.org
gwa apply --api-version v3 -i gw-config.yml

Giving an error: [GatewayService]: Not Found

rustyjux commented 5 months ago

Hmm I can publish a config created w/ the new kong-httpbin template from the updated cli, if I use the old cli (and API v2, ie not specified) to publish. But when I run against API v3 using the updated CLI or the old one, I get the same error.

Could this error by tracing back to API v3?

ikethecoder commented 5 months ago

Ah, yes great, I built gwa with the updated env var and that resolved.