diff --git a/scripts/chaos-containers.lua b/scripts/chaos-containers.lua index be10dda..cf01167 100644 --- a/scripts/chaos-containers.lua +++ b/scripts/chaos-containers.lua @@ -34,7 +34,7 @@ elseif ngx.var.request_method == "POST" and action == 'set' then ngx.say("New chaos container definition has been configured in Redis") return ngx.exit(ngx.status) -elseif ngx.var.request_method == "POST" and action == "set_log_regex" then +elseif ngx.var.request_method == "POST" and action == "set_log_regex" then local body_data = ngx.req.get_body_data() red:set("log_pod_regex:" .. arg['id'], body_data) red:set("programming_mode", "0") @@ -43,7 +43,7 @@ elseif ngx.var.request_method == "POST" and action == "set_log_regex" then ngx.log(ngx.ERR, "Set Regex for web log tail. log id " .. arg['id']) return ngx.exit(ngx.status) -elseif ngx.var.request_method == "POST" and action == "enable_log_tail" then +elseif ngx.var.request_method == "POST" and action == "enable_log_tail" then local body_data = ngx.req.get_body_data() red:set("logs_enabled:" .. arg['id'], "1") red:set("programming_mode", "0") @@ -52,7 +52,7 @@ elseif ngx.var.request_method == "POST" and action == "enable_log_tail" then ngx.say("Enable Log Tail for log id " .. arg['id']) return ngx.exit(ngx.status) -elseif ngx.var.request_method == "POST" and action == "disable_log_tail" then +elseif ngx.var.request_method == "POST" and action == "disable_log_tail" then red:set("logs_enabled:" .. arg['id'], "0") red:set("programming_mode", "0") -- os.execute("> /var/www/html/chaoslogs-" .. arg['id'] .. ".html") diff --git a/scripts/metrics_loop/start.py b/scripts/metrics_loop/start.py index 12a0369..735e833 100644 --- a/scripts/metrics_loop/start.py +++ b/scripts/metrics_loop/start.py @@ -83,7 +83,6 @@ while True: for pod in api_response.items: if pod.metadata.labels.get('approle') != None and pod.metadata.labels['approle'] == 'chaosnode': - logging.info(pod.status.phase) if pod.status.phase == "Pending" or pod.status.phase == "Running": r.incr('current_chaos_job_pod') time.sleep(1) diff --git a/scripts/programming_mode.lua b/scripts/programming_mode.lua index 82a3ac9..58d39ef 100644 --- a/scripts/programming_mode.lua +++ b/scripts/programming_mode.lua @@ -45,7 +45,7 @@ ngx.log(ngx.ERR, "[programming_mode] remove log_cleaner:" ..arg['id'] .. " Redis red:del("log_cleaner:" .. arg['id']) ngx.log(ngx.ERR, "[programming_mode] set logs_enabled:" .. arg['id'] .. " Redis key") -red:set("logs_enabled:" .. arg['id']) +red:set("logs_enabled:" .. arg['id'], "1") local handle = io.popen("python3 /opt/programming_mode/start.py " .. file_name .. " " .. k8s_url) local result = handle:read("*a")