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

Running TestDeployAllInOneDBLESS with updated router flavor to expressions breaks router priority #4990

Closed
1 task done
pmalek opened this issue Oct 26, 2023 · 1 comment
Closed
1 task done
Assignees
Labels
area/tests bug Something isn't working
Milestone

Comments

@pmalek
Copy link
Member

pmalek commented Oct 26, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When running e2e tests from #4934, specifically TestDeployAllInOneDBLESS, we seem to generate routes with extremely high priorities.

Exemplar CI failure: https:/Kong/kubernetes-ingress-controller/actions/runs/6654763042/job/18083851027#step:9:804

This is the dumped configuration when the test is running:

_transform: false
_format_version: '3.0'
workspaces:
  - id: 0dc6f45b-8f8d-40d2-a504-473544ee190b
    created_at: 1698340425
    updated_at: 1698340425
    config:
      portal_auto_approve: ~
      portal_auth_conf: ~
      portal_auth: ~
      meta: ~
      portal_emails_reply_to: ~
      portal_emails_from: ~
      portal_reset_success_email: ~
      portal_application_status_email: ~
      portal_session_conf: ~
      portal_application_request_email: ~
      portal_reset_email: ~
      portal_approved_email: ~
      portal: false
      portal_access_request_email: ~
      portal_developer_meta_fields: '[{"label":"Full Name","title":"full_name","validator":{"required":true,"type":"string"}}]'
      portal_invite_email: ~
      portal_cors_origins: ~
      portal_is_legacy: ~
      portal_smtp_admin_emails: ~
      portal_token_exp: ~
    meta:
      color: ~
      thumbnail: ~
    comment: ~
    name: default
services:
  - protocol: http
    updated_at: 1698340425
    read_timeout: 60000
    name: default.echo.1027
    host: echo.default.1027.svc
    id: 4a3125fc-7d51-5575-b0f3-978d9a44a49b
    tls_verify: ~
    tls_verify_depth: ~
    write_timeout: 60000
    connect_timeout: 60000
    ca_certificates: ~
    path: /
    port: 1027
    created_at: 1698340425
    tags:
      - k8s-name:echo
      - k8s-namespace:default
      - k8s-kind:Service
      - k8s-uid:668007fb-789d-4e2c-8371-398d3353ff69
      - k8s-version:v1
    client_certificate: ~
    enabled: true
    ws_id: 0dc6f45b-8f8d-40d2-a504-473544ee190b
    retries: 5
routes:
  - request_buffering: true
    expression: ((http.path == "/echo") || (http.path ^= "/echo/")) && (http.method == "GET")
    preserve_host: true
    name: default.echo.echo..1027
    response_buffering: true
    updated_at: 1698340425
    https_redirect_status_code: 426
    ws_id: 0dc6f45b-8f8d-40d2-a504-473544ee190b
    id: 6ece5df4-2c97-5372-a840-47e222d4ea9d
    created_at: 1698340425
    tags:
      - k8s-name:echo
      - k8s-namespace:default
      - k8s-kind:Ingress
      - k8s-uid:6eb54997-0c70-4a68-918b-935a356f14cd
      - k8s-group:networking.k8s.io
      - k8s-version:v1
    priority: 3.3820977671045e+15
    service: 4a3125fc-7d51-5575-b0f3-978d9a44a49b
    protocols:
      - http
      - https
    strip_path: true
upstreams:
  - updated_at: 1698340425
    name: echo.default.1027.svc
    hash_on: none
    id: 404ab532-774d-589f-a0b6-e84845c64955
    hash_on_header: ~
    slots: 10000
    hash_on_uri_capture: ~
    healthchecks:
      threshold: 0
      active:
        headers: ~
        type: http
        concurrency: 10
        https_sni: ~
        https_verify_certificate: true
        healthy:
          successes: 0
          http_statuses:
            - 200
            - 302
          interval: 0
        http_path: /
        timeout: 1
        unhealthy:
          interval: 0
          tcp_failures: 0
          timeouts: 0
          http_failures: 0
          http_statuses:
            - 429
            - 404
            - 500
            - 501
            - 502
            - 503
            - 504
            - 505
      passive:
        unhealthy:
          http_statuses:
            - 429
            - 500
            - 503
          timeouts: 0
          http_failures: 0
          tcp_failures: 0
        healthy:
          successes: 0
          http_statuses:
            - 200
            - 201
            - 202
            - 203
            - 204
            - 205
            - 206
            - 207
            - 208
            - 226
            - 300
            - 301
            - 302
            - 303
            - 304
            - 305
            - 306
            - 307
            - 308
        type: http
    created_at: 1698340425
    hash_on_cookie: ~
    hash_on_cookie_path: /
    client_certificate: ~
    use_srv_name: false
    algorithm: round-robin
    hash_fallback_query_arg: ~
    hash_fallback: none
    hash_fallback_header: ~
    tags:
      - k8s-name:echo
      - k8s-namespace:default
      - k8s-kind:Service
      - k8s-uid:668007fb-789d-4e2c-8371-398d3353ff69
      - k8s-version:v1
    hash_fallback_uri_capture: ~
    ws_id: 0dc6f45b-8f8d-40d2-a504-473544ee190b
    host_header: ~
    hash_on_query_arg: ~
targets:
  - target: 10.244.0.43:1027
    id: 2d55ec75-c3b8-5cd6-83b1-c8cef405e477
    created_at: 1698340425.159
    tags: ~
    upstream: 404ab532-774d-589f-a0b6-e84845c64955
    ws_id: 0dc6f45b-8f8d-40d2-a504-473544ee190b
    updated_at: 1698340425.159
    weight: 100
  - target: 10.244.0.42:1027
    id: 171530d6-6d5a-5ac9-982a-7c51e026f30d
    created_at: 1698340425.159
    tags: ~
    upstream: 404ab532-774d-589f-a0b6-e84845c64955
    ws_id: 0dc6f45b-8f8d-40d2-a504-473544ee190b
    updated_at: 1698340425.159
    weight: 100
  - target: 10.244.0.41:1027
    id: 806e74f8-b88a-5d06-a137-6ccca4f837e1
    created_at: 1698340425.159
    tags: ~
    upstream: 404ab532-774d-589f-a0b6-e84845c64955
    ws_id: 0dc6f45b-8f8d-40d2-a504-473544ee190b
    updated_at: 1698340425.159
    weight: 100

We can observe the following errors in the logs

    helpers_test.go:527: failed dumping config: routes: json: cannot unmarshal number 3.3820977671045e+15 into Go struct field Route.priority of type int

go-kong's route priority is specified as int: https:/Kong/go-kong/blob/70c450fea7d2eae44bb0b08a6d7cb6fe0cb5e45a/kong/route.go#L16-L17

Dumping KIC generated configuration seems to confirm the number (albeit in the non-scientific format)

{
	"tags": [
		"k8s-name:echo",
		"k8s-namespace:default",
		"k8s-kind:Ingress",
		"k8s-uid:81836894-513b-48d7-ad96-39f08ba3c0d4",
		"k8s-group:networking.k8s.io",
		"k8s-version:v1"
	],
	"strip_path": true,
	"expression": "((http.path == \"/echo\") || (http.path ^= \"/echo/\")) && (http.method == \"GET\")",
	"id": "6ece5df4-2c97-5372-a840-47e222d4ea9d",
	"updated_at": 1698335193,
	"created_at": 1698335193,
	"service": {
		"id": "4a3125fc-7d51-5575-b0f3-978d9a44a49b"
	},
	"request_buffering": true,
	"response_buffering": true,
	"preserve_host": true,
	"protocols": [
		"http",
		"https"
	],
	"priority": 3382097767104500,
	"name": "default.echo.echo..1027",
	"https_redirect_status_code": 426
}
{
	"response_buffering": true,
	"tags": [
		"k8s-name:echo",
		"k8s-namespace:default",
		"k8s-kind:Ingress",
		"k8s-uid:81836894-513b-48d7-ad96-39f08ba3c0d4",
		"k8s-group:networking.k8s.io",
		"k8s-version:v1"
	],
	"updated_at": 1698335193,
	"service": {
		"id": "4a3125fc-7d51-5575-b0f3-978d9a44a49b"
	},
	"request_buffering": true,
	"expression": "((http.path == \"/echo\") || (http.path ^= \"/echo/\")) && (http.method == \"GET\")",
	"id": "6ece5df4-2c97-5372-a840-47e222d4ea9d",
	"priority": 3382097767104500,
	"strip_path": true,
	"https_redirect_status_code": 426,
	"preserve_host": true,
	"protocols": [
		"http",
		"https"
	],
	"name": "default.echo.echo..1027",
	"created_at": 1698335193
}

Expected Behavior

No errors, e2e test passes without error.

Steps To Reproduce

No response

Kong Ingress Controller version

`main`

Kubernetes version

1.28

Anything else?

No response

@pmalek pmalek added the bug Something isn't working label Oct 26, 2023
@pmalek pmalek added this to the KIC v3.0.0 milestone Oct 26, 2023
@pmalek pmalek changed the title Running TestDeployAllInOneDBLESS with updater router flavor to expressions breaks router priority Running TestDeployAllInOneDBLESS with updated router flavor to expressions breaks router priority Oct 27, 2023
@pmalek pmalek self-assigned this Oct 31, 2023
@pmalek
Copy link
Member Author

pmalek commented Oct 31, 2023

Related Gateway FTI which when solved will prevent Gateway from sending route priority in scientific notation: https://konghq.atlassian.net/browse/FTI-5515

This can be closed now with #5024 merged.

@pmalek pmalek closed this as completed Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tests bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant