Skip to content

Make kong2tf plugin aware#1979

Merged
harshadixit12 merged 4 commits into
mainfrom
kong2tf-plugin-aware
Apr 15, 2026
Merged

Make kong2tf plugin aware#1979
harshadixit12 merged 4 commits into
mainfrom
kong2tf-plugin-aware

Conversation

@mheap

@mheap mheap commented Apr 7, 2026

Copy link
Copy Markdown
Member

Automatically generate a konnect_gateway_custom_plugin instance if the provided plugin is not in the list of bundled plugins.

You can update the bundled plugins by running make generate-plugin-list while running a Gateway locally.

@mheap mheap requested a review from harshadixit12 April 7, 2026 14:27
@codecov-commenter

codecov-commenter commented Apr 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 32.87%. Comparing base (6b96392) to head (0a43b47).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
kong2tf/generate_resource.go 92.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1979      +/-   ##
==========================================
+ Coverage   32.77%   32.87%   +0.10%     
==========================================
  Files          77       77              
  Lines        7046     7064      +18     
==========================================
+ Hits         2309     2322      +13     
- Misses       4543     4546       +3     
- Partials      194      196       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mheap mheap force-pushed the kong2tf-plugin-aware branch 3 times, most recently from 5ee2fb5 to bd242dc Compare April 8, 2026 12:51
@mheap mheap added skip-konnect Skip Konnect Integration tests in CI skip-ee Skip Enterprise Integration Tests in CI skip-oss Skip Open Source Integration Tests in CI labels Apr 8, 2026
@mheap mheap force-pushed the kong2tf-plugin-aware branch from bd242dc to d21287a Compare April 11, 2026 00:48
@mheap mheap force-pushed the kong2tf-plugin-aware branch from d21287a to 31d9863 Compare April 11, 2026 14:35
delete(entity, "name")
// If `name` is not in availablePlugins, then it's a custom plugin and
// we should use the plugin name as the resource name
if !contains(availablePlugins, entity["name"].(string)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When a new plugin is introduced in a new kong gateway version - wouldn't the previously released versions of deck treat it as custom plugin

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's correct. That's the tradeoff we're making (it would still work, just without schema checks in TF)

if customizations == nil {
customizations = map[string]string{}
}
customizations["config"] = "jsonencode"

@harshadixit12 harshadixit12 Apr 15, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we do jsonencode - underlying value of config is a string in https://github.com/Kong/terraform-provider-konnect/blob/main/src/custom_plugin_model.go#L40 - config.String() returns string wrapped in additonal characters, which breaks unmarshal. (ex: output is "\"{\\\"hello\\\":\\\"world\\\"}\"" instead of "{\"hello\":\"world\"}")
We'll need to fix this in custom_plugin_model.go (i'll do it)

I don't think we need to block this PR though.

@harshadixit12 harshadixit12 merged commit 3221c8b into main Apr 15, 2026
12 checks passed
@harshadixit12 harshadixit12 deleted the kong2tf-plugin-aware branch April 15, 2026 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-ee Skip Enterprise Integration Tests in CI skip-konnect Skip Konnect Integration tests in CI skip-oss Skip Open Source Integration Tests in CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants