Open Tieske opened 2 months ago
@mikefero iirc you pointed out in the past that we needed to remove those dynamic names. Can you have a quick look, and see what other adjustements we need to make to make this work with Konnect?
Yeah, the name can't be dynamic based on the file path because the plugin is not uploaded to Konnect, only the schema is.
return require("kong.plugins." .. plugin_name .. ".schema")
Another issue is the returning of the schema definition using require. This won't work in Konnect as the schemas are loaded/injected into the metaschema portion of Kong Gateway and a global plugins definition is created to handle the "bundled" plugins.
@mikefero , is there a workaround or another approach we could try here? It is common for users to clone plugins using this updater, and it will be great if it is supported on Konnect.
Unfortunately there is no workaround for this generalized approach in Konnect. We do not use the file system of Kong Gateway and we only use the metaschema library for handling plugin configurations. The only way to do this is not dynamic like showcased here and return the full schema which is not ideal and not generic.
it gives this error:
Error: "{ "message":"[string "-- This is generated code, DO NOT UPDATE!..."]:6: attempt to index a nil value", "request_id":"ce3c001a3f0c021be03de62bbc8e241c" }"
I think this is because of things like this: https://github.com/Kong/priority-updater/blob/master/template/plugin/schema.lua#L6
We have removed those from other plugins that had them.
reported by : @akoshok1