Skip to content

Commit 82c6296

Browse files
committed
feat(api): add field stream to PodLogOptions
Signed-off-by: Jian Zeng <[email protected]>
1 parent f451aec commit 82c6296

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

pkg/apis/core/types.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5503,6 +5503,15 @@ type Preconditions struct {
55035503
UID *types.UID
55045504
}
55055505

5506+
const (
5507+
// LogStreamStdout is the stream type for stdout.
5508+
LogStreamStdout = "Stdout"
5509+
// LogStreamStderr is the stream type for stderr.
5510+
LogStreamStderr = "Stderr"
5511+
// LogStreamAll represents the combined stdout and stderr.
5512+
LogStreamAll = "All"
5513+
)
5514+
55065515
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
55075516

55085517
// PodLogOptions is the query options for a Pod's logs REST call
@@ -5529,7 +5538,8 @@ type PodLogOptions struct {
55295538
// of log output.
55305539
Timestamps bool
55315540
// If set, the number of lines from the end of the logs to show. If not specified,
5532-
// logs are shown from the creation of the container or sinceSeconds or sinceTime
5541+
// logs are shown from the creation of the container or sinceSeconds or sinceTime.
5542+
// Note that when "TailLines" is specified, "Stream" can only be set to nil or "All".
55335543
TailLines *int64
55345544
// If set, the number of bytes to read from the server before terminating the
55355545
// log output. This may not display a complete final line of logging, and may return
@@ -5544,6 +5554,14 @@ type PodLogOptions struct {
55445554
// the actual log data coming from the real kubelet).
55455555
// +optional
55465556
InsecureSkipTLSVerifyBackend bool
5557+
5558+
// Specify which container log stream to return to the client.
5559+
// Acceptable values are "All", "Stdout" and "Stderr". If not specified, "All" is used, and both stdout and stderr
5560+
// are returned interleaved.
5561+
// Note that when "TailLines" is specified, "Stream" can only be set to nil or "All".
5562+
// +featureGate=PodLogsQuerySplitStreams
5563+
// +optional
5564+
Stream *string
55475565
}
55485566

55495567
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

staging/src/k8s.io/api/core/v1/types.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6574,6 +6574,15 @@ type Preconditions struct {
65746574
UID *types.UID `json:"uid,omitempty" protobuf:"bytes,1,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"`
65756575
}
65766576

6577+
const (
6578+
// LogStreamStdout is the stream type for stdout.
6579+
LogStreamStdout = "Stdout"
6580+
// LogStreamStderr is the stream type for stderr.
6581+
LogStreamStderr = "Stderr"
6582+
// LogStreamAll represents the combined stdout and stderr.
6583+
LogStreamAll = "All"
6584+
)
6585+
65776586
// +k8s:conversion-gen:explicit-from=net/url.Values
65786587
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
65796588
// +k8s:prerelease-lifecycle-gen:introduced=1.0
@@ -6608,7 +6617,8 @@ type PodLogOptions struct {
66086617
// +optional
66096618
Timestamps bool `json:"timestamps,omitempty" protobuf:"varint,6,opt,name=timestamps"`
66106619
// If set, the number of lines from the end of the logs to show. If not specified,
6611-
// logs are shown from the creation of the container or sinceSeconds or sinceTime
6620+
// logs are shown from the creation of the container or sinceSeconds or sinceTime.
6621+
// Note that when "TailLines" is specified, "Stream" can only be set to nil or "All".
66126622
// +optional
66136623
TailLines *int64 `json:"tailLines,omitempty" protobuf:"varint,7,opt,name=tailLines"`
66146624
// If set, the number of bytes to read from the server before terminating the
@@ -6625,6 +6635,14 @@ type PodLogOptions struct {
66256635
// the actual log data coming from the real kubelet).
66266636
// +optional
66276637
InsecureSkipTLSVerifyBackend bool `json:"insecureSkipTLSVerifyBackend,omitempty" protobuf:"varint,9,opt,name=insecureSkipTLSVerifyBackend"`
6638+
6639+
// Specify which container log stream to return to the client.
6640+
// Acceptable values are "All", "Stdout" and "Stderr". If not specified, "All" is used, and both stdout and stderr
6641+
// are returned interleaved.
6642+
// Note that when "TailLines" is specified, "Stream" can only be set to nil or "All".
6643+
// +featureGate=PodLogsQuerySplitStreams
6644+
// +optional
6645+
Stream *string `json:"stream,omitempty" protobuf:"varint,10,opt,name=stream"`
66286646
}
66296647

66306648
// +k8s:conversion-gen:explicit-from=net/url.Values

0 commit comments

Comments
 (0)