Remove 3rd party lua plugin support (#11821)

This commit is contained in:
Ricardo Katz 2024-08-21 10:54:29 -03:00 committed by GitHub
parent bfd65d6c59
commit 3bec99ecfc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 2 additions and 258 deletions

View file

@ -67,8 +67,6 @@ http {
balancer.init_worker()
monitor.init_worker(10000)
plugins.run()
}
map $request_uri $loggable {
@ -120,7 +118,6 @@ http {
use_port_in_redirects = false,
})
balancer.rewrite()
plugins.run()
}
# be careful with `access_by_lua_block` and `satisfy any` directives as satisfy any
@ -130,7 +127,6 @@ http {
header_filter_by_lua_block {
lua_ingress.header()
plugins.run()
}
}

View file

@ -86,11 +86,8 @@ lua_shared_dict ocsp_response_cache 5M;
init_worker_by_lua_block {
lua_ingress.init_worker()
balancer.init_worker()
monitor.init_worker(10000)
plugins.run()
monitor.init_worker(10000)
}
@ -164,7 +161,6 @@ lua_shared_dict ocsp_response_cache 5M;
use_port_in_redirects = false,
})
balancer.rewrite()
plugins.run()
}
# be careful with `access_by_lua_block` and `satisfy any` directives as satisfy any
@ -174,7 +170,6 @@ lua_shared_dict ocsp_response_cache 5M;
header_filter_by_lua_block {
lua_ingress.header()
plugins.run()
}

View file

@ -1,55 +0,0 @@
/*
Copyright 2020 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package settings
import (
"fmt"
"net/http"
"strings"
"github.com/onsi/ginkgo/v2"
"k8s.io/ingress-nginx/test/e2e/framework"
)
var _ = framework.IngressNginxDescribe("plugins", func() {
f := framework.NewDefaultFramework("plugins")
ginkgo.BeforeEach(func() {
f.NewEchoDeployment()
})
ginkgo.It("should exist a x-hello-world header", func() {
f.UpdateNginxConfigMapData("plugins", "hello_world, invalid")
host := "example.com"
f.EnsureIngress(framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, nil))
f.WaitForNginxConfiguration(
func(server string) bool {
return strings.Contains(server, fmt.Sprintf("server_name %v", host)) &&
strings.Contains(server, `plugins.init({ "hello_world","invalid" })`)
})
f.HTTPTestClient().
GET("/").
WithHeader("Host", host).
WithHeader("User-Agent", "hello").
Expect().
Status(http.StatusOK).
Body().Contains("x-hello-world=1")
})
})

View file

@ -41,7 +41,7 @@ SHDICT_ARGS=(
)
if [ $# -eq 0 ]; then
resty "${SHDICT_ARGS[@]}" ./rootfs/etc/nginx/lua/test/ ./rootfs/etc/nginx/lua/plugins/**/test ${BUSTED_ARGS}
resty "${SHDICT_ARGS[@]}" ./rootfs/etc/nginx/lua/test/ ${BUSTED_ARGS}
else
resty "${SHDICT_ARGS[@]}" $@ ${BUSTED_ARGS}
fi