-
Notifications
You must be signed in to change notification settings - Fork 39.9k
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
API: Allow Stream
to be set in PodLogOptions
#110794
Conversation
/priority important-soon |
1e367a6
to
a19ad80
Compare
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
c7bf679
to
abd91bd
Compare
@smarterclayton @SergeyKanzhelev Hi, sorry for the late response I finally managed to rewrite the code a bit, addressing the comments, and I would like to point out that I decided to change the API semantics when Right now, when user specifies both For instance, let's say the logs of a container is as follows:
If a user request the container logs with The reason I made this decision is I found out the implementation of the latter requires parsing log entry to extract It is worth mentioning that, dockerd takes the same approach, which can be verified by the following steps: Run an example container:
Since $ cat main.gopackage main
import (
"context"
"flag"
"os"
"github.com/docker/docker/api/types"
"github.com/docker/docker/client"
"github.com/docker/docker/pkg/stdcopy"
)
func main() {
var tail string
flag.StringVar(&tail, "n", "1", "tail last n lines")
flag.Parse()
cli, err := client.NewClientWithOpts(client.WithAPIVersionNegotiation(), client.WithHostFromEnv())
if err != nil {
panic(err)
}
reader, err := cli.ContainerLogs(context.TODO(), "testlogs", types.ContainerLogsOptions{
ShowStdout: true,
Tail: tail,
})
if err != nil {
panic(err)
}
_, err = stdcopy.StdCopy(os.Stdout, os.Stderr, reader)
if err != nil {
panic(err)
}
}
|
Signed-off-by: Jian Zeng <[email protected]>
Signed-off-by: Jian Zeng <[email protected]>
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. |
What's the status of this PR? This would be very helpful and it looks like it's stagnant? Is this awaiting the author just for a rebase? |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closed this PR. In response to this:
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. |
/reopen |
@knight42: Reopened this PR. In response to this:
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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: knight42 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Since there is too much merge conflict in this PR, I will open a new one. |
I have filed a new PR #127360 |
What type of PR is this?
/kind feature
/kind api-change
What this PR does / why we need it:
This PR adds the feature gate and API for kubernetes/enhancements#3288 as well as validation rules to prevent inconsistent values. Changes about API, kube-apiserver and kubelet is included in this PR.
Special notes for your reviewer:
I would like to file another PR to update kubectl in case the volume of this PR is too large.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: