mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Merge pull request #67033 from juanvallejo/jvallejo/add-corev1-pod-kubectl-conditions
Automatic merge from submit-queue (batch tested with PRs 58058, 67033, 66921, 66956). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. expose default LogsForObject consumeRequest func **Release note**: ```release-note NONE ``` Expose the `consumeRequest` func to make it reusable for other consumers of the `LogsForObject` polymorphic func
This commit is contained in:
commit
dda37a52ec
@ -214,7 +214,7 @@ func (o *LogsOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []str
|
||||
return err
|
||||
}
|
||||
|
||||
o.ConsumeRequestFn = consumeRequest
|
||||
o.ConsumeRequestFn = DefaultConsumeRequest
|
||||
|
||||
o.GetPodTimeout, err = cmdutil.GetPodRunningTimeoutFlag(cmd)
|
||||
if err != nil {
|
||||
@ -305,7 +305,7 @@ func (o LogsOptions) RunLogs() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func consumeRequest(request *rest.Request, out io.Writer) error {
|
||||
func DefaultConsumeRequest(request *rest.Request, out io.Writer) error {
|
||||
readCloser, err := request.Stream()
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -530,7 +530,7 @@ func logOpts(restClientGetter genericclioptions.RESTClientGetter, pod *corev1.Po
|
||||
return err
|
||||
}
|
||||
for _, request := range requests {
|
||||
if err := consumeRequest(request, opts.Out); err != nil {
|
||||
if err := DefaultConsumeRequest(request, opts.Out); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user