Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to run follow + label #63614

Closed
wants to merge 1 commit into from

Conversation

gabrielsvinha
Copy link

What this PR does / why we need it:
Remove check for follow + selector when running kubectl logs -l -f

Which issue(s) this PR fixes
Fixes #52218

@k8s-ci-robot
Copy link
Contributor

@gabrielsvinha: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

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.

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 9, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: GabrielSVinha
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: smarterclayton

Assign the PR to them by writing /assign @smarterclayton in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 9, 2018
@k8s-ci-robot k8s-ci-robot requested review from dims and dshulyak May 9, 2018 18:07
@dims
Copy link
Member

dims commented May 9, 2018

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 9, 2018
@gabrielsvinha
Copy link
Author

/assign @smarterclayton

@gabrielsvinha
Copy link
Author

/release-note-none

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels May 10, 2018
@ereslibre
Copy link
Contributor

ereslibre commented May 22, 2018

I have a comment regarding this feature. This patch won't work as-is (unless I'm wrong) because when you reach:

_, err = io.Copy(o.Out, readCloser)

on the first pod, this operation will block, and you won't follow the rest of the pod logs, only the first one. I started to work on this yesterday, and I have something very similar:

master...ereslibre:follow-selector

However, I wanted to take more things into account before submitting a PR. Meaning: what happens if in the process of following a selector logs (e.g. kubectl logs -f -lapp=myapp) its pods are modified (e.g. killed because of a liveness probe and brought back). In this case, the patch I have won't work either, I don't know if that's within the scope of kubectl logs or we just want to ignore those edge cases. When you follow a specific pod in current kubernetes and it dies, you lose the follow and the process ends (obviously), but with a selector there's two viable options:

  1. Ignore whatever happens in the future. We only follow the set of pods that matched the selector at the time of triggering the logs command.
  2. While you are following the logs, keep track of the pod changes and follow those too if new pods appear.

I think a simple approach could be the ideal case first, but as said, this PR won't actually follow a set of pods correctly because it'll lock on the first one.

Copy link
Member

@dixudx dixudx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this really does implement this.

@dixudx
Copy link
Member

dixudx commented Aug 1, 2018

Agree with @ereslibre. This PR does not really implement this feature.

@k8s-ci-robot
Copy link
Contributor

@gabrielsvinha: PR needs rebase.

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.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 4, 2018
@dims
Copy link
Member

dims commented Sep 18, 2018

/uncc

@k8s-ci-robot k8s-ci-robot removed the request for review from dims September 18, 2018 12:57
@fejta-bot
Copy link

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-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 17, 2018
@fejta-bot
Copy link

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-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 16, 2019
@fejta-bot
Copy link

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-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closed this PR.

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-testing, kubernetes/test-infra and/or fejta.
/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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kubectl logs should allow -f, -l, and -c together
7 participants