This commit is contained in:
Eugenio Marzo
2022-10-23 15:49:38 +02:00
parent 0a105426af
commit 764052e53b
2 changed files with 4 additions and 4 deletions

View File

@@ -213,7 +213,7 @@ function setRedisLogRegex() {
if (log_tail_switch) {
var oReq = new XMLHttpRequest();
oReq.open("GET", "https://" + clu_endpoint + "/kube/chaos/containers?action=disabled_logs_tail", true);
oReq.open("GET", "https://" + clu_endpoint + "/kube/chaos/containers?action=disable_logs_tail", true);
oReq.onreadystatechange = function () {
if (this.readyState === XMLHttpRequest.DONE && this.status === 200) {
@@ -225,7 +225,7 @@ function setRedisLogRegex() {
} else {
var oReq = new XMLHttpRequest();
oReq.open("POST", "https://" + clu_endpoint + "/kube/chaos/containers?action=enabled_logs_tail", true);
oReq.open("POST", "https://" + clu_endpoint + "/kube/chaos/containers?action=enable_logs_tail", true);
oReq.onreadystatechange = function () {
if (this.readyState === XMLHttpRequest.DONE && this.status === 200) {

View File

@@ -33,13 +33,13 @@ elseif ngx.var.request_method == "POST" and action == 'set' then
red:set("chaos_container", body_data)
ngx.say("New chaos container definition has been configured in Redis")
return ngx.exit(ngx.status)
elseif ngx.var.request_method == "POST" and action == "enabled_logs_tail" then
elseif ngx.var.request_method == "POST" and action == "enable_logs_tail" then
local body_data = ngx.req.get_body_data()
red:set("log_pod_regex", body_data)
red:set("logs_enabled", "1")
ngx.say("New container definition has been saved in Redis")
return ngx.exit(ngx.status)
elseif ngx.var.request_method == "POST" and action == "disabled_logs_tail" then
elseif ngx.var.request_method == "GET" and action == "disable_logs_tail" then
red:set("logs_enabled", "0")
ngx.say("New container definition has been saved in Redis")
return ngx.exit(ngx.status)