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

decK uses the wrong default for strip_path #555

Closed
Benny-Git opened this issue Dec 28, 2021 · 1 comment
Closed

decK uses the wrong default for strip_path #555

Benny-Git opened this issue Dec 28, 2021 · 1 comment

Comments

@Benny-Git
Copy link

Issue description

decK v0.4.0 changed the default for strip_path to be false. The default for Kong however is for the default to be true.
I would argue that decK simply should not set a default, and leave the value empty if not explicitly set by the user.

The original issue (which introduced this change) was about not being able to set the value to false at all.
Unfortunately the fix for this also changed the default value to false.

The description in the commit reads

Breaking change:

This is a limitation of how we fill in default values for the missing
values. It is not possible in Go to determine if a value is nil vs a
zero vaule (false for boolean).

Is there any other way to fix this?
This issue broke our Kong db-less to db-based migration, as the yaml configs imported via decK suddenly observed a different default behavior.

Links

@GGabriele
Copy link
Collaborator

#573 solved this.

Default behaviour (true):

$ cat kong.yaml
services:
- name: svc1
  host: mockbin.org
  routes:
  - name: r1
    paths:
    - /r1

$ deck sync
Summary:
  Created: 0
  Updated: 0
  Deleted: 0

$ http :8001/routes/r1 | jq .strip_path
true

Setting it to false:

$ cat kong.yaml
services:
- name: svc1
  host: mockbin.org
  routes:
  - name: r1
    paths:
    - /r1
    strip_path: false

$ deck sync
updating route r1  {
   "https_redirect_status_code": 426,
   "id": "3b93896c-a7ba-4824-b8ee-43f2479fa077",
   "name": "r1",
   "path_handling": "v0",
   "paths": [
     "/r1"
   ],
   "preserve_host": false,
   "protocols": [
     "http",
     "https"
   ],
   "regex_priority": 0,
   "request_buffering": true,
   "response_buffering": true,
   "service": {
     "id": "850eed3e-d0f4-451d-b885-b4873989d097"
   },
-  "strip_path": true
+  "strip_path": false
 }

Summary:
  Created: 0
  Updated: 1
  Deleted: 0

$ http :8001/routes/r1 | jq .strip_path
false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants