Skip to content

[kube-prometheus-stack] Allow to set a timezone for the default grafana dashboards #1326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Sep 20, 2021
Prev Previous commit
Next Next commit
#780 Improved regex
Signed-off-by: Fabio Kruger <[email protected]>
  • Loading branch information
krufab committed Sep 15, 2021
commit 89b76f0aee94cd524eee813cc6a32b0d6948c4e3
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def patch_json_for_multicluster_configuration(content, multicluster_key):

def patch_json_set_timezone_as_variable(content):
# content is no more in json format, so we have to replace using regex
return re.sub(r'"timezone"\s*:\s*"(\\.|[^\"])*"', '"timezone": "\{\{ .Value.grafana.defaultDashboardsTimezone \}\}"', content, flags=re.IGNORECASE|re.MULTILINE)
return re.sub(r'"timezone"\s*:\s*"(?:\\.|[^\"])*"', '"timezone": "\{\{ .Value.grafana.defaultDashboardsTimezone \}\}"', content, flags=re.IGNORECASE)


def write_group_to_file(resource_name, content, url, destination, min_kubernetes, max_kubernetes, multicluster_key):
Expand Down