Skip to content
This repository has been archived by the owner on Dec 1, 2018. It is now read-only.

Add ability to follow logs with Pod.logs #127

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pykube/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def ready(self):

def logs(self, container=None, pretty=None, previous=False,
since_seconds=None, since_time=None, timestamps=False,
tail_lines=None, limit_bytes=None):
tail_lines=None, limit_bytes=None, follow=False):
"""
Produces the same result as calling kubectl logs pod/<pod-name>.
Check parameters meaning at
Expand All @@ -332,6 +332,8 @@ def logs(self, container=None, pretty=None, previous=False,
params["tailLines"] = int(tail_lines)
if limit_bytes is not None:
params["limitBytes"] = int(limit_bytes)
if follow:
params["follow"] = "true"

query_string = urlencode(params)
log_call += "?{}".format(query_string) if query_string else ""
Expand Down