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:
Kubernetes Submit Queue 2018-08-06 17:01:08 -07:00 committed by GitHub
commit dda37a52ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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
}
}