Failed to load the resty.core module when using include with js_import in http-snippet #13135
Labels
kind/support
Categorizes issue or PR as a support question.
needs-priority
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
Adding module to the base image
I'm customizing the ingress-nginx controller by using a modified nginx-base image. Specifically, I want to add the NJS module to enable advanced CORS handling logic via js_import and js_header_filter directives.
I build my own nginx-base image based on registry.k8s.io/ingress-nginx/nginx:v1.2.1, only added the NJS module.
Source
Built from the helm-chart-4.12.1 branch
The issue
When I use the custom base image and enable my custom CORS logic via http-snippet in the HelmRelease config:
I get the following error:
failed to load the 'resty.core' module
Which seems unrelated to my CORS config or NJS module.
Why this is weird
This error disappears when I comment out the http-snippet. But the snippet itself only references js_import (NJS), and does not use Lua at all.
It seems like enabling NJS somehow triggers Lua module loading even when Lua isn't used.
What I want to know
Is this behavior expected?
Why does including an http-snippet that only uses js_import (NJS) cause the controller to try loading resty.core?
Is there a config option to disable Lua entirely and avoid this error?
Also tried building from main, from branches starting with controller v1.12.0 down to v1.10.0, and from helm-chart-4.12.1 down to helm-chart-4.10.0 - same result every time.
Tried both building manually and using the current ci.yaml from a fork of the ingress-nginx repo.
Thanks in advance.
cc @rikatz @strongjz
The text was updated successfully, but these errors were encountered: