Kong / Kong/deck

Deck sees blacklist/whitelist in plugins as diffs when run against Kong 2.X

Open
#1,258 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
503
Forks
137
Avg merge
3d 5h
Merged PRs (30d)
20

Description

We are upgrading Kong from 2.0 to 2.8, i know its still old but its a required step before we can upgrade to Kong 3 as Kong requires 2.1 min to upgrade.

Kong 2.1 changed plugins acl, ip-restriction & bot-detection to use allow/deny field but still supported the old whitelist/blacklist fields , they are converted to allow/deny on import.

Deck will sync configs with whitelist/blacklist as Kong converts them, but when running a diff it shows them as drifts.

Using deck 1.36.1 and Kong 2.8 and a config file

```yaml
plugins:
- name: acl
config:
blacklist: null
whitelist:
- sdk-consumers
```

Running deck gateway sync results in
```
creating plugin acl (global)
Summary:
Created: 1
Updated: 0
Deleted: 0
```

Now running a deck gateway diff results in the following drift
```
updating plugin acl (global) {
"config": {
- "allow": [
- "sdk-consumers"
- ],
+ "allow": null,
"deny": null,
"hide_groups_header": false
+ "blacklist": null
+ "whitelist": [
+ "sdk-consumers"
+ ]
},
"enabled": true,
"id": "5fe48c16-5e63-4189-bcfb-a72d3b72b04c",
"name": "acl",
"protocols": [
"grpc",
"grpcs",
"http",
"https"
]
}

Summary:
Created: 0
Updated: 1
Deleted: 0
```

I looked at the possibility of using default to fix this but plugins dont support defaults according to the docs..

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the supplied YAML plugin configuration and reproduce the behavior using `deck gateway sync` followed by `deck gateway diff` against Kong 2.8. Trace how the diff represents Kong's conversion from `whitelist`/`blacklist` to `allow`/`deny`; done means the converted configuration no longer appears as drift.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, yaml
Domain
cli, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.