Skip to content

Add since_time parameter to read_namespaced_pod_log #1351

Description

@neelsomani

What happened (please include outputs or screenshots):

The docstring makes reference to both the sinceSeconds and sinceTime parameters which exist in the CLI, but I see that only the since_seconds kwarg is accepted by the Python client

What you expected to happen:

I expected the since_time kwarg to be accepted

How to reproduce it (as minimally and precisely as possible):

Pass since_time attribute to the CoreV1Api method read_namespaced_pod_log

Anything else we need to know?:

n/a

Environment:

  • Kubernetes version (kubectl version): v1.19.0
  • OS (e.g., MacOS 10.13.6): Linux
  • Python version (python --version) 3.6.10
  • Python client version (pip list | grep kubernetes) 12.0.0

Activity

  1. added
    kind/bugCategorizes issue or PR as related to a bug.
    on Jan 9, 2021
  2. neelsomani commented on Jan 9, 2021

    @neelsomani
    Author

    Would be happy to add this parameter myself, just not sure how - I saw the CoreV1Api code is generated so I figure I'm not supposed to edit that directly

  3. pigletfly commented on Jan 15, 2021

    @pigletfly

    actually, it's supported already, read_namespaced_pod_log(self, name,namespace, **kwargs), just pass since_seconds in kwargs.

  4. neelsomani commented on Jan 15, 2021

    @neelsomani
    Author

    Yeah I'm currently using since_seconds, this issue is about since_time though

  5. yliaog commented on Feb 1, 2021

    @yliaog
    Contributor

    /cc

  6. yliaog commented on Feb 1, 2021

    @yliaog
    Contributor
  7. neelsomani commented on Feb 1, 2021

    @neelsomani
    Author

    Interesting, it didn't seem to work for me with the Python client but I ended up not needing this feature anyway. I'm fine with closing the issue.

  8. neelsomani commented on Feb 2, 2021

    @neelsomani
    Author

    Yeah totally fine with closing it but just wondering, why is there no since_time parameter mentioned in the generated code here: https://raw.githubusercontent.com/kubernetes-client/python/master/kubernetes/client/api/core_v1_api.py

  9. yliaog commented on Feb 8, 2021

    @yliaog
    Contributor

    https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/swagger.json is the openapi spec used for generating python client in this repo. sinceseconds is present there, but sincetime is not.

  10. fejta-bot commented on May 13, 2021

    @fejta-bot

    Issues go stale after 90d of inactivity.
    Mark the issue as fresh with /remove-lifecycle stale.
    Stale issues rot after an additional 30d of inactivity and eventually close.

    If this issue is safe to close now please do so with /close.

    Send feedback to sig-contributor-experience at kubernetes/community.
    /lifecycle stale

  11. added
    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.
    on May 13, 2021
  12. fejta-bot commented on Jun 12, 2021

    @fejta-bot

    Stale issues rot after 30d of inactivity.
    Mark the issue as fresh with /remove-lifecycle rotten.
    Rotten issues close after an additional 30d of inactivity.

    If this issue is safe to close now please do so with /close.

    Send feedback to sig-contributor-experience at kubernetes/community.
    /lifecycle rotten

  13. added
    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.
    and removed
    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.
    on Jun 12, 2021
  14. fejta-bot commented on Jul 12, 2021

    @fejta-bot

    Rotten issues close after 30d of inactivity.
    Reopen the issue with /reopen.
    Mark the issue as fresh with /remove-lifecycle rotten.

    Send feedback to sig-contributor-experience at kubernetes/community.
    /close

  15. k8s-ci-robot commented on Jul 12, 2021

    @k8s-ci-robot
    Contributor

    @fejta-bot: Closing this issue.

    Details

    In response to this:

    Rotten issues close after 30d of inactivity.
    Reopen the issue with /reopen.
    Mark the issue as fresh with /remove-lifecycle rotten.

    Send feedback to sig-contributor-experience at kubernetes/community.
    /close

    Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

  16. jessekv commented on Dec 13, 2021

    @jessekv

    possibly a bug (or at least documentation error), since_time is referenced in the description of since_seconds, but the field itself does not exist.
    {
    "description": "A relative time in seconds before the current time from which to show logs. If this value precedes the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified.",
    "in": "query",
    "name": "sinceSeconds",
    "type": "integer",
    "uniqueItems": true
    }

  17. ZW007 commented on May 2, 2024

    @ZW007

    @yliaog @vdwees @neelsomani @pigletfly May I ask how to use this sinceSeconds? I could not understand what does it mean by A relative time in seconds before the current time from which to show logs. If this value precedes the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned For example, i want to log from the beginning, (I can set it seconds in 10 years, which is way before the pod being created), then make a stop (enable logs timestamp, record this timestamp), then stream log from where I stopped. Any suggestion?

  18. k8s-ci-robot commented on Jun 27, 2025

    @k8s-ci-robot
    Contributor

    @MoritzWeber0: You can't reopen an issue/PR unless you authored it or you are a collaborator.

    Details

    In response to this:

    /reopen

    Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions