From e65aff238b0245d5c20143099e483f2165743a6b Mon Sep 17 00:00:00 2001 From: Daniela Plascencia Date: Sun, 4 Feb 2024 01:19:46 +0100 Subject: [PATCH] feat: set meshConfig.accessLogFile configuration for exposing logs (#371) * feat: set meshConfig.accessLogFile configuration for exposing logs This setting allow users to access debug logs. Fixes #370 --- charms/istio-pilot/src/charm.py | 3 +++ charms/istio-pilot/tests/unit/test_charm.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/charms/istio-pilot/src/charm.py b/charms/istio-pilot/src/charm.py index 2cf735c3..a018720c 100755 --- a/charms/istio-pilot/src/charm.py +++ b/charms/istio-pilot/src/charm.py @@ -211,6 +211,7 @@ def _istioctl_extra_flags(self): # Extra flags to pass to the istioctl install command # These flags will configure the container images used by the control plane + # As well as set the access log files for help during debugging extra_flags = [ "--set", f"values.pilot.image={pilot_image}", @@ -222,6 +223,8 @@ def _istioctl_extra_flags(self): f"values.global.proxy.image={global_proxy_image}", "--set", f"values.global.proxy_init.image={global_proxy_init_image}", + "--set", + "meshConfig.accessLogFile=/dev/stdout", ] # The following are a set of flags that configure the CNI behaviour diff --git a/charms/istio-pilot/tests/unit/test_charm.py b/charms/istio-pilot/tests/unit/test_charm.py index 41784469..5a8c697c 100644 --- a/charms/istio-pilot/tests/unit/test_charm.py +++ b/charms/istio-pilot/tests/unit/test_charm.py @@ -1372,6 +1372,8 @@ def test_upgrade_successful( "values.global.proxy.image=proxyv2", "--set", "values.global.proxy_init.image=proxyv2", + "--set", + "meshConfig.accessLogFile=/dev/stdout", ], ) mocked_istioctl.upgrade.assert_called_with()