added kube-linter

This commit is contained in:
Eugenio Marzo
2021-10-02 18:06:52 +02:00
parent abd97d0751
commit 913c6ed2a5
6 changed files with 80 additions and 42 deletions

15
scripts/kube-linter.lua Normal file
View File

@@ -0,0 +1,15 @@
ngx.header['Access-Control-Allow-Origin'] = '*'
ngx.header['Access-Control-Allow-Methods'] = 'GET, POST, OPTIONS'
ngx.header['Access-Control-Allow-Headers'] = 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'
ngx.header['Access-Control-Expose-Headers'] = 'Content-Length,Content-Range';
ngx.req.read_body()
local request_body = ngx.req.get_body_data()
local arg = ngx.req.get_uri_args()
local namespace = arg['namespace']
local handle = io.popen("/opt/kube-linter-parser.sh " .. namespace)
local result = handle:read("*a")
ngx.say(result)