From 0a04bbbd9225bc76251bd3624486b6327d4eb37d Mon Sep 17 00:00:00 2001 From: Maciej Szulik Date: Mon, 4 Feb 2019 13:18:02 +0100 Subject: [PATCH] Rename AttachableLogsForObjectFunc -> AttachablePodForObjectFunc to better reflect its purpose --- pkg/kubectl/cmd/attach/attach.go | 2 +- pkg/kubectl/cmd/attach/attach_test.go | 2 +- pkg/kubectl/polymorphichelpers/interface.go | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/kubectl/cmd/attach/attach.go b/pkg/kubectl/cmd/attach/attach.go index c0bfd78316..94c343857c 100644 --- a/pkg/kubectl/cmd/attach/attach.go +++ b/pkg/kubectl/cmd/attach/attach.go @@ -76,7 +76,7 @@ type AttachOptions struct { AttachFunc func(*AttachOptions, *corev1.Container, bool, remotecommand.TerminalSizeQueue) func() error Resources []string Builder func() *resource.Builder - AttachablePodFn polymorphichelpers.AttachableLogsForObjectFunc + AttachablePodFn polymorphichelpers.AttachablePodForObjectFunc restClientGetter genericclioptions.RESTClientGetter Attach RemoteAttach diff --git a/pkg/kubectl/cmd/attach/attach_test.go b/pkg/kubectl/cmd/attach/attach_test.go index 30edc2db1d..cd5a061a40 100644 --- a/pkg/kubectl/cmd/attach/attach_test.go +++ b/pkg/kubectl/cmd/attach/attach_test.go @@ -51,7 +51,7 @@ func (f *fakeRemoteAttach) Attach(method string, url *url.URL, config *restclien return f.err } -func fakeAttachablePodFn(pod *corev1.Pod) polymorphichelpers.AttachableLogsForObjectFunc { +func fakeAttachablePodFn(pod *corev1.Pod) polymorphichelpers.AttachablePodForObjectFunc { return func(getter genericclioptions.RESTClientGetter, obj runtime.Object, timeout time.Duration) (*corev1.Pod, error) { return pod, nil } diff --git a/pkg/kubectl/polymorphichelpers/interface.go b/pkg/kubectl/polymorphichelpers/interface.go index 816bf91427..f93ff0d279 100644 --- a/pkg/kubectl/polymorphichelpers/interface.go +++ b/pkg/kubectl/polymorphichelpers/interface.go @@ -34,11 +34,11 @@ type LogsForObjectFunc func(restClientGetter genericclioptions.RESTClientGetter, // LogsForObjectFn gives a way to easily override the function for unit testing if needed. var LogsForObjectFn LogsForObjectFunc = logsForObject -// AttachableLogsForObjectFunc is a function type that can tell you how to get the pod for which to attach a given object -type AttachableLogsForObjectFunc func(restClientGetter genericclioptions.RESTClientGetter, object runtime.Object, timeout time.Duration) (*v1.Pod, error) +// AttachablePodForObjectFunc is a function type that can tell you how to get the pod for which to attach a given object +type AttachablePodForObjectFunc func(restClientGetter genericclioptions.RESTClientGetter, object runtime.Object, timeout time.Duration) (*v1.Pod, error) // AttachablePodForObjectFn gives a way to easily override the function for unit testing if needed. -var AttachablePodForObjectFn AttachableLogsForObjectFunc = attachablePodForObject +var AttachablePodForObjectFn AttachablePodForObjectFunc = attachablePodForObject // HistoryViewerFunc is a function type that can tell you how to view change history type HistoryViewerFunc func(restClientGetter genericclioptions.RESTClientGetter, mapping *meta.RESTMapping) (kubectl.HistoryViewer, error)