Skip to content

Commit 17cc0f5

Browse files
committed
pod_log: add type; add timestamp option
1 parent 239d635 commit 17cc0f5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/warnet/k8s.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from kubernetes.dynamic import DynamicClient
1414
from kubernetes.stream import stream
1515
from kubernetes.utils import create_from_yaml
16+
from urllib3 import HTTPResponse
1617

1718
from .constants import KUBECONFIG
1819

@@ -347,14 +348,15 @@ def wait_for_caddy_ready(name, namespace, timeout=300):
347348
return False
348349

349350

350-
def pod_log(pod_name, container_name=None, follow=False):
351+
def pod_log(pod_name, container_name=None, follow=False, timestamps=False) -> HTTPResponse:
351352
sclient = get_static_client()
352353
try:
353354
return sclient.read_namespaced_pod_log(
354355
name=pod_name,
355356
namespace=get_default_namespace(),
356357
container=container_name,
357358
follow=follow,
359+
timestamps=timestamps,
358360
_preload_content=False,
359361
)
360362
except ApiException as e:

0 commit comments

Comments
 (0)