Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
0a04bbbd
Unverified
Commit
0a04bbbd
authored
Feb 04, 2019
by
Maciej Szulik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename AttachableLogsForObjectFunc -> AttachablePodForObjectFunc to better reflect its purpose
parent
c5da2c55
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
attach.go
pkg/kubectl/cmd/attach/attach.go
+1
-1
attach_test.go
pkg/kubectl/cmd/attach/attach_test.go
+1
-1
interface.go
pkg/kubectl/polymorphichelpers/interface.go
+3
-3
No files found.
pkg/kubectl/cmd/attach/attach.go
View file @
0a04bbbd
...
...
@@ -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
.
Attachable
Logs
ForObjectFunc
AttachablePodFn
polymorphichelpers
.
Attachable
Pod
ForObjectFunc
restClientGetter
genericclioptions
.
RESTClientGetter
Attach
RemoteAttach
...
...
pkg/kubectl/cmd/attach/attach_test.go
View file @
0a04bbbd
...
...
@@ -51,7 +51,7 @@ func (f *fakeRemoteAttach) Attach(method string, url *url.URL, config *restclien
return
f
.
err
}
func
fakeAttachablePodFn
(
pod
*
corev1
.
Pod
)
polymorphichelpers
.
Attachable
Logs
ForObjectFunc
{
func
fakeAttachablePodFn
(
pod
*
corev1
.
Pod
)
polymorphichelpers
.
Attachable
Pod
ForObjectFunc
{
return
func
(
getter
genericclioptions
.
RESTClientGetter
,
obj
runtime
.
Object
,
timeout
time
.
Duration
)
(
*
corev1
.
Pod
,
error
)
{
return
pod
,
nil
}
...
...
pkg/kubectl/polymorphichelpers/interface.go
View file @
0a04bbbd
...
...
@@ -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
// Attachable
Logs
ForObjectFunc is a function type that can tell you how to get the pod for which to attach a given object
type
Attachable
Logs
ForObjectFunc
func
(
restClientGetter
genericclioptions
.
RESTClientGetter
,
object
runtime
.
Object
,
timeout
time
.
Duration
)
(
*
v1
.
Pod
,
error
)
// Attachable
Pod
ForObjectFunc is a function type that can tell you how to get the pod for which to attach a given object
type
Attachable
Pod
ForObjectFunc
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
Attachable
Logs
ForObjectFunc
=
attachablePodForObject
var
AttachablePodForObjectFn
Attachable
Pod
ForObjectFunc
=
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment