Skip to content

Commit 62236b8

Browse files
committed
pod_log: add type; add timestamp option
1 parent 1fdee00 commit 62236b8

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 (
1819
CADDY_INGRESS_NAME,
@@ -376,14 +377,15 @@ def get_ingress_ip_or_host():
376377
return None
377378

378379

379-
def pod_log(pod_name, container_name=None, follow=False):
380+
def pod_log(pod_name, container_name=None, follow=False, timestamps=False) -> HTTPResponse:
380381
sclient = get_static_client()
381382
try:
382383
return sclient.read_namespaced_pod_log(
383384
name=pod_name,
384385
namespace=get_default_namespace(),
385386
container=container_name,
386387
follow=follow,
388+
timestamps=timestamps,
387389
_preload_content=False,
388390
)
389391
except ApiException as e:

0 commit comments

Comments
 (0)