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 shows differences with route that have more than 3 methods defined #503

Open
gchristidis opened this issue Oct 7, 2021 · 9 comments
Assignees

Comments

@gchristidis
Copy link

It appears that deck (v 1.8.2) does not like having more than 3 methods defined in a route.

The following yaml shows the issue with a route with more than 3 methods, i have used 2 select tags as thats what i am using

_format_version: '1.1'
_info:
  select_tags:
  - test
  - route
routes:
- methods:
  - GET
  - DELETE
  - POST
  - PUT
  - PATCH
  name: test_route
  https_redirect_status_code: 426
  path_handling: v1

Running a deck sync creates the route but when you run a diff or a sync again it shows its updating the route but with no change flags (+-) on any line. Looking at the output closely you see its only showing 3 elements in the methods.

updating route test_route {
   "https_redirect_status_code": 426,
   "id": "985c5808-f55f-4766-932d-d091e89abfc2",
   "methods": [
     "GET",
     "PATCH",
     "POST",
   ],
   "name": "test_route",
   "path_handling": "v1",
   "preserve_host": false,
   "protocols": [
     "http",
     "https"
   ],
   "regex_priority": 0,
   "strip_path": false,
   "tags": [
     "test",
   ]
 }

Summary:
  Created: 0
  Updated: 1
  Deleted: 0

Looking at the route from the admin api you see all the methods

{
  "strip_path": false,
  "tags": [
    "route",
    "test"
  ],
  "paths": null,
  "destinations": null,
  "headers": null,
  "protocols": [
    "http",
    "https"
  ],
  "created_at": 1633605274,
  "snis": null,
  "service": null,
  "name": "test_route",
  "methods": [
    "DELETE",
    "GET",
    "PATCH",
    "POST",
    "PUT"
  ],
  "preserve_host": false,
  "regex_priority": 0,
  "updated_at": 1633605274,
  "sources": null,
  "id": "985c5808-f55f-4766-932d-d091e89abfc2",
  "https_redirect_status_code": 426,
  "hosts": null,
  "path_handling": "v1"
}
@GGabriele
Copy link
Collaborator

Hi @gchristidis , can you please give us more info about how you installed decK, what system are you running etc? I tested installing 1.8.2 both from source and by downloading and running the binary directly, but couldn't be able to reproduce the issue.

@gchristidis
Copy link
Author

HI @GGabriele, I am just downloading deck 1.8.2 and using it directly. Its running against a Kong 1.5.1 instance backed by a Datastax Enterprise Cassandra instance both of which are running on an ubuntu 16.05.

Here is the verbose output from a deck diff of the above yaml file after its already been sync'd
deck_sync.txt

You can see the debug message from the /routes call it contains "methods":["DELETE","GET","PATCH","POST","PUT"] but the deck output shows only GET, PATCH & POST methods with the summary saying 1 updated.

@hbagdi
Copy link
Member

hbagdi commented Feb 1, 2022

Closing this due to lack of activity. Please re-open if needed.

@hbagdi hbagdi closed this as completed Feb 1, 2022
@GGabriele GGabriele reopened this Feb 1, 2022
@gchristidis
Copy link
Author

@GGabriele has this been resolved ?

@GGabriele
Copy link
Collaborator

@gchristidis I wasn't able to reproduce this issue with the same decK and Kong versions :\ are you able to check if you get the same with a newer Kong version?

@gchristidis
Copy link
Author

gchristidis commented Feb 16, 2022

@GGabriele Yes its still occurs, like I said I use deck 1.8.2 with Kong 1.5.1 backed by cassandra (Datastax enterprise 6.7).
However i have managed to get the same result using docker images for Kong 2.7, Cassandra 3 and the latest deck. The test_kong.sh below is a bash script that runs the docker images, downloads deck and uses it to apply a simple yaml file with a route that has 5 methods. It then does a diff and reports it as a difference showing only 3 methods.

The output towards the end shows the following. The diff should show no diffs but it outputs the route with only 3 methods shown and a summary that says updated 1. Doing a sync also shows the same.

Running deck sync for the first time
creating route test_route
Summary:
  Created: 1
  Updated: 0
  Deleted: 0
Running deck diff to check status - THERE SHOULD BE NO DIFFERENCES BUT THERE IS
updating route test_route  {
   "https_redirect_status_code": 426,
   "id": "2ec471d6-629c-459e-801b-1a74c4c53c88",
   "methods": [
     "GET",
     "PATCH",
     "POST",
   ],
   "name": "test_route",
   "path_handling": "v1",
   "preserve_host": false,
   "protocols": [
     "http",
     "https"
   ],
   "regex_priority": 0,
   "request_buffering": true,
   "response_buffering": true,
   "strip_path": false,
   "tags": [
     "test",
   ]
 }

Summary:
  Created: 0
  Updated: 1
  Deleted: 0

@hbagdi hbagdi reopened this Feb 16, 2022
@hbagdi
Copy link
Member

hbagdi commented Feb 16, 2022

This seems like a Cassandra-specific issue.
Can you run deck diff --verbose 2? That will show the response that is returned from Kong.

Also, please note that Cassandra with Kong has been deprecated: https://github.com/Kong/kong/blob/master/CHANGELOG.md#270

@gchristidis
Copy link
Author

My comment on the 17th Jan has a link deck_sync.txt that has that output. Yes I was aware of Cassandra deprecation.

@99hops
Copy link

99hops commented Mar 9, 2022

I also experience similar issue with Kong 2.8.0-alpine and DecK 1.11.0 in docker containers

deck sync --skip-consumers -s /kong.yaml

updating route keys  {
    "https_redirect_status_code": 426,
    "id": "4c052c8d-c522-476d-8b10-448ae4aa113a",
    "methods": [
      "GET",
      "POST",
      "DELETE",
      "OPTIONS"
    ],
    "name": "keys",
 -  "path_handling": "v0",
    "paths": [
      "/xxx"
    ],
    "preserve_host": false,
    "protocols": [
      "https"
    ],
    "regex_priority": 0,
    "request_buffering": true,
    "response_buffering": true,
    "service": {
      "id": "94229057-a6d6-42eb-af64-e48f9070e462"
    },
    "strip_path": false
  }

Summary:
   Created: 0
   Updated: 1
   Deleted: 0

Second run without and change in the /kong.yaml

updating route keys  {
   "https_redirect_status_code": 426,
   "id": "4c052c8d-c522-476d-8b10-448ae4aa113a",
   "methods": [
     "GET",
     "POST",
     "DELETE",
     "OPTIONS"
   ],
   "name": "keys",
-  "path_handling": "v0",
   "paths": [
     "/xxx"
   ],
   "preserve_host": false,
   "protocols": [
     "https"
   ],
   "regex_priority": 0,
   "request_buffering": true,
   "response_buffering": true,
   "service": {
     "id": "94229057-a6d6-42eb-af64-e48f9070e462"
   },
   "strip_path": false
 }

Summary:
  Created: 0
  Updated: 1
  Deleted: 0

And this happens each time I ran the command, what could be causing this?!

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

No branches or pull requests

4 participants