feat(api): add field stream to PodLogOptions

Signed-off-by: Jian Zeng <anonymousknight96@gmail.com>
This commit is contained in:
Jian Zeng
2024-09-11 21:38:41 +08:00
parent f451aec237
commit 82c6296a95
2 changed files with 38 additions and 2 deletions

View File

@@ -5503,6 +5503,15 @@ type Preconditions struct {
UID *types.UID
}
const (
// LogStreamStdout is the stream type for stdout.
LogStreamStdout = "Stdout"
// LogStreamStderr is the stream type for stderr.
LogStreamStderr = "Stderr"
// LogStreamAll represents the combined stdout and stderr.
LogStreamAll = "All"
)
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PodLogOptions is the query options for a Pod's logs REST call
@@ -5529,7 +5538,8 @@ type PodLogOptions struct {
// of log output.
Timestamps bool
// If set, the number of lines from the end of the logs to show. If not specified,
// logs are shown from the creation of the container or sinceSeconds or sinceTime
// logs are shown from the creation of the container or sinceSeconds or sinceTime.
// Note that when "TailLines" is specified, "Stream" can only be set to nil or "All".
TailLines *int64
// If set, the number of bytes to read from the server before terminating the
// log output. This may not display a complete final line of logging, and may return
@@ -5544,6 +5554,14 @@ type PodLogOptions struct {
// the actual log data coming from the real kubelet).
// +optional
InsecureSkipTLSVerifyBackend bool
// Specify which container log stream to return to the client.
// Acceptable values are "All", "Stdout" and "Stderr". If not specified, "All" is used, and both stdout and stderr
// are returned interleaved.
// Note that when "TailLines" is specified, "Stream" can only be set to nil or "All".
// +featureGate=PodLogsQuerySplitStreams
// +optional
Stream *string
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

View File

@@ -6574,6 +6574,15 @@ type Preconditions struct {
UID *types.UID `json:"uid,omitempty" protobuf:"bytes,1,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"`
}
const (
// LogStreamStdout is the stream type for stdout.
LogStreamStdout = "Stdout"
// LogStreamStderr is the stream type for stderr.
LogStreamStderr = "Stderr"
// LogStreamAll represents the combined stdout and stderr.
LogStreamAll = "All"
)
// +k8s:conversion-gen:explicit-from=net/url.Values
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:prerelease-lifecycle-gen:introduced=1.0
@@ -6608,7 +6617,8 @@ type PodLogOptions struct {
// +optional
Timestamps bool `json:"timestamps,omitempty" protobuf:"varint,6,opt,name=timestamps"`
// If set, the number of lines from the end of the logs to show. If not specified,
// logs are shown from the creation of the container or sinceSeconds or sinceTime
// logs are shown from the creation of the container or sinceSeconds or sinceTime.
// Note that when "TailLines" is specified, "Stream" can only be set to nil or "All".
// +optional
TailLines *int64 `json:"tailLines,omitempty" protobuf:"varint,7,opt,name=tailLines"`
// If set, the number of bytes to read from the server before terminating the
@@ -6625,6 +6635,14 @@ type PodLogOptions struct {
// the actual log data coming from the real kubelet).
// +optional
InsecureSkipTLSVerifyBackend bool `json:"insecureSkipTLSVerifyBackend,omitempty" protobuf:"varint,9,opt,name=insecureSkipTLSVerifyBackend"`
// Specify which container log stream to return to the client.
// Acceptable values are "All", "Stdout" and "Stderr". If not specified, "All" is used, and both stdout and stderr
// are returned interleaved.
// Note that when "TailLines" is specified, "Stream" can only be set to nil or "All".
// +featureGate=PodLogsQuerySplitStreams
// +optional
Stream *string `json:"stream,omitempty" protobuf:"varint,10,opt,name=stream"`
}
// +k8s:conversion-gen:explicit-from=net/url.Values