-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add missing protocols field to plugins
All plugin entities are expected to have a `protocols` schema field, but some plugin schemas are missing it. From a functional point of view, this doesn't have any impact, since the `protocols` field is still injected in the overall schema. But when plugin schemas are retrieved via the Admin API using the `/schemas/plugins/<name>` endpoint, then the "original" schema is returned. For example: ``` $ http :8001/schemas/plugins/prometheus HTTP/1.1 200 OK Access-Control-Allow-Origin: * Connection: keep-alive Content-Length: 354 Content-Type: application/json; charset=utf-8 Date: Tue, 11 Oct 2022 06:42:47 GMT Server: kong/3.0.0 X-Kong-Admin-Latency: 6 { "fields": [ { "config": { "fields": [ { "per_consumer": { "default": false, "type": "boolean" } }, { "status_code_metrics": { "default": false, "type": "boolean" } }, { "latency_metrics": { "default": false, "type": "boolean" } }, { "bandwidth_metrics": { "default": false, "type": "boolean" } }, { "upstream_health_metrics": { "default": false, "type": "boolean" } } ], "required": true, "type": "record" } } ] } ``` This is problematic for decK, which uses this endpoint to inject schema defaults before doing a deployment, which can cause unnecessary/misleading diffs: ``` $ cat kong.yaml _format_version: "3.0" plugins: - name: prometheus $ deck sync updating plugin prometheus (global) { "config": { "bandwidth_metrics": false, "latency_metrics": false, "per_consumer": false, "status_code_metrics": false, "upstream_health_metrics": false }, "enabled": true, "id": "93aece4b-b813-4d9b-af28-f4c1c874f128", "name": "prometheus", - "protocols": [ - "grpc", - "grpcs", - "http", - "https" - ] } Summary: Created: 0 Updated: 1 Deleted: 0 ```
- Loading branch information
Showing
10 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters