Be able to specify the timeout to wait for pod for kubectl logs/attach

This commit is contained in:
shiywang
2017-02-22 00:19:13 +08:00
parent b0ce93f9be
commit 52e4be2578
11 changed files with 97 additions and 29 deletions

View File

@@ -376,7 +376,7 @@ func (f *FakeFactory) LabelsForObject(runtime.Object) (map[string]string, error)
return nil, nil
}
func (f *FakeFactory) LogsForObject(object, options runtime.Object) (*restclient.Request, error) {
func (f *FakeFactory) LogsForObject(object, options runtime.Object, timeout time.Duration) (*restclient.Request, error) {
return nil, nil
}
@@ -423,7 +423,7 @@ func (f *FakeFactory) CanBeAutoscaled(schema.GroupKind) error {
return nil
}
func (f *FakeFactory) AttachablePodForObject(ob runtime.Object) (*api.Pod, error) {
func (f *FakeFactory) AttachablePodForObject(ob runtime.Object, timeout time.Duration) (*api.Pod, error) {
return nil, nil
}
@@ -613,7 +613,7 @@ func (f *fakeAPIFactory) Printer(mapping *meta.RESTMapping, options printers.Pri
return f.tf.Printer, f.tf.Err
}
func (f *fakeAPIFactory) LogsForObject(object, options runtime.Object) (*restclient.Request, error) {
func (f *fakeAPIFactory) LogsForObject(object, options runtime.Object, timeout time.Duration) (*restclient.Request, error) {
c, err := f.ClientSet()
if err != nil {
panic(err)
@@ -635,7 +635,7 @@ func (f *fakeAPIFactory) LogsForObject(object, options runtime.Object) (*restcli
}
}
func (f *fakeAPIFactory) AttachablePodForObject(object runtime.Object) (*api.Pod, error) {
func (f *fakeAPIFactory) AttachablePodForObject(object runtime.Object, timeout time.Duration) (*api.Pod, error) {
switch t := object.(type) {
case *api.Pod:
return t, nil