mirror of https://github.com/k3s-io/k3s
Rename AttachableLogsForObjectFunc -> AttachablePodForObjectFunc to better reflect its purpose
parent
c5da2c559f
commit
0a04bbbd92
|
@ -76,7 +76,7 @@ type AttachOptions struct {
|
||||||
AttachFunc func(*AttachOptions, *corev1.Container, bool, remotecommand.TerminalSizeQueue) func() error
|
AttachFunc func(*AttachOptions, *corev1.Container, bool, remotecommand.TerminalSizeQueue) func() error
|
||||||
Resources []string
|
Resources []string
|
||||||
Builder func() *resource.Builder
|
Builder func() *resource.Builder
|
||||||
AttachablePodFn polymorphichelpers.AttachableLogsForObjectFunc
|
AttachablePodFn polymorphichelpers.AttachablePodForObjectFunc
|
||||||
restClientGetter genericclioptions.RESTClientGetter
|
restClientGetter genericclioptions.RESTClientGetter
|
||||||
|
|
||||||
Attach RemoteAttach
|
Attach RemoteAttach
|
||||||
|
|
|
@ -51,7 +51,7 @@ func (f *fakeRemoteAttach) Attach(method string, url *url.URL, config *restclien
|
||||||
return f.err
|
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 func(getter genericclioptions.RESTClientGetter, obj runtime.Object, timeout time.Duration) (*corev1.Pod, error) {
|
||||||
return pod, nil
|
return pod, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,11 +34,11 @@ type LogsForObjectFunc func(restClientGetter genericclioptions.RESTClientGetter,
|
||||||
// LogsForObjectFn gives a way to easily override the function for unit testing if needed.
|
// LogsForObjectFn gives a way to easily override the function for unit testing if needed.
|
||||||
var LogsForObjectFn LogsForObjectFunc = logsForObject
|
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
|
// AttachablePodForObjectFunc 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)
|
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.
|
// 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
|
// 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)
|
type HistoryViewerFunc func(restClientGetter genericclioptions.RESTClientGetter, mapping *meta.RESTMapping) (kubectl.HistoryViewer, error)
|
||||||
|
|
Loading…
Reference in New Issue