Allows to read from multiple logs simultaneously

Which makes possible to combile the `-f` and `-l` flags in kubectl logs
This commit is contained in:
Mikalai Radchuk
2018-08-18 07:42:48 +01:00
parent c6977e5aac
commit 2a230cc119
4 changed files with 367 additions and 55 deletions

View File

@@ -29,7 +29,7 @@ import (
)
// LogsForObjectFunc is a function type that can tell you how to get logs for a runtime.object
type LogsForObjectFunc func(restClientGetter genericclioptions.RESTClientGetter, object, options runtime.Object, timeout time.Duration, allContainers bool) ([]*rest.Request, error)
type LogsForObjectFunc func(restClientGetter genericclioptions.RESTClientGetter, object, options runtime.Object, timeout time.Duration, allContainers bool) ([]rest.ResponseWrapper, error)
// LogsForObjectFn gives a way to easily override the function for unit testing if needed.
var LogsForObjectFn LogsForObjectFunc = logsForObject