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
f116a5eb
Commit
f116a5eb
authored
Jan 18, 2016
by
Random-Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove temporary function GetPodStatusAndAPIPodStatus()
parent
2d061aa1
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
42 deletions
+7
-42
fake_runtime.go
pkg/kubelet/container/fake_runtime.go
+0
-11
runtime.go
pkg/kubelet/container/runtime.go
+0
-3
runtime_mock.go
pkg/kubelet/container/runtime_mock.go
+0
-5
manager.go
pkg/kubelet/dockertools/manager.go
+0
-11
manager_test.go
pkg/kubelet/dockertools/manager_test.go
+7
-1
rkt.go
pkg/kubelet/rkt/rkt.go
+0
-11
No files found.
pkg/kubelet/container/fake_runtime.go
View file @
f116a5eb
...
@@ -259,17 +259,6 @@ func (f *FakeRuntime) ConvertPodStatusToAPIPodStatus(_ *api.Pod, _ *PodStatus) (
...
@@ -259,17 +259,6 @@ func (f *FakeRuntime) ConvertPodStatusToAPIPodStatus(_ *api.Pod, _ *PodStatus) (
return
&
status
,
f
.
Err
return
&
status
,
f
.
Err
}
}
func
(
f
*
FakeRuntime
)
GetPodStatusAndAPIPodStatus
(
_
*
api
.
Pod
)
(
*
PodStatus
,
*
api
.
PodStatus
,
error
)
{
f
.
Lock
()
defer
f
.
Unlock
()
// This is only a temporary function, it should be logged as GetAPIPodStatus
f
.
CalledFunctions
=
append
(
f
.
CalledFunctions
,
"GetAPIPodStatus"
)
apiPodStatus
:=
f
.
APIPodStatus
podStatus
:=
f
.
PodStatus
return
&
podStatus
,
&
apiPodStatus
,
f
.
Err
}
func
(
f
*
FakeRuntime
)
ExecInContainer
(
containerID
ContainerID
,
cmd
[]
string
,
stdin
io
.
Reader
,
stdout
,
stderr
io
.
WriteCloser
,
tty
bool
)
error
{
func
(
f
*
FakeRuntime
)
ExecInContainer
(
containerID
ContainerID
,
cmd
[]
string
,
stdin
io
.
Reader
,
stdout
,
stderr
io
.
WriteCloser
,
tty
bool
)
error
{
f
.
Lock
()
f
.
Lock
()
defer
f
.
Unlock
()
defer
f
.
Unlock
()
...
...
pkg/kubelet/container/runtime.go
View file @
f116a5eb
...
@@ -82,9 +82,6 @@ type Runtime interface {
...
@@ -82,9 +82,6 @@ type Runtime interface {
// exists to determine the reason). We should try generalizing the logic
// exists to determine the reason). We should try generalizing the logic
// for all container runtimes in kubelet and remove this funciton.
// for all container runtimes in kubelet and remove this funciton.
ConvertPodStatusToAPIPodStatus
(
*
api
.
Pod
,
*
PodStatus
)
(
*
api
.
PodStatus
,
error
)
ConvertPodStatusToAPIPodStatus
(
*
api
.
Pod
,
*
PodStatus
)
(
*
api
.
PodStatus
,
error
)
// Return both PodStatus and api.PodStatus, this is just a temporary function.
// TODO(random-liu): Remove this method later
GetPodStatusAndAPIPodStatus
(
*
api
.
Pod
)
(
*
PodStatus
,
*
api
.
PodStatus
,
error
)
// PullImage pulls an image from the network to local storage using the supplied
// PullImage pulls an image from the network to local storage using the supplied
// secrets if necessary.
// secrets if necessary.
PullImage
(
image
ImageSpec
,
pullSecrets
[]
api
.
Secret
)
error
PullImage
(
image
ImageSpec
,
pullSecrets
[]
api
.
Secret
)
error
...
...
pkg/kubelet/container/runtime_mock.go
View file @
f116a5eb
...
@@ -87,11 +87,6 @@ func (r *Mock) GetPodStatus(uid types.UID, name, namespace string) (*PodStatus,
...
@@ -87,11 +87,6 @@ func (r *Mock) GetPodStatus(uid types.UID, name, namespace string) (*PodStatus,
return
args
.
Get
(
0
)
.
(
*
PodStatus
),
args
.
Error
(
1
)
return
args
.
Get
(
0
)
.
(
*
PodStatus
),
args
.
Error
(
1
)
}
}
func
(
r
*
Mock
)
GetPodStatusAndAPIPodStatus
(
pod
*
api
.
Pod
)
(
*
PodStatus
,
*
api
.
PodStatus
,
error
)
{
args
:=
r
.
Called
(
pod
)
return
args
.
Get
(
0
)
.
(
*
PodStatus
),
args
.
Get
(
0
)
.
(
*
api
.
PodStatus
),
args
.
Error
(
2
)
}
func
(
r
*
Mock
)
ConvertPodStatusToAPIPodStatus
(
pod
*
api
.
Pod
,
podStatus
*
PodStatus
)
(
*
api
.
PodStatus
,
error
)
{
func
(
r
*
Mock
)
ConvertPodStatusToAPIPodStatus
(
pod
*
api
.
Pod
,
podStatus
*
PodStatus
)
(
*
api
.
PodStatus
,
error
)
{
args
:=
r
.
Called
(
pod
,
podStatus
)
args
:=
r
.
Called
(
pod
,
podStatus
)
return
args
.
Get
(
0
)
.
(
*
api
.
PodStatus
),
args
.
Error
(
1
)
return
args
.
Get
(
0
)
.
(
*
api
.
PodStatus
),
args
.
Error
(
1
)
...
...
pkg/kubelet/dockertools/manager.go
View file @
f116a5eb
...
@@ -2172,14 +2172,3 @@ func (dm *DockerManager) GetPodStatus(uid types.UID, name, namespace string) (*k
...
@@ -2172,14 +2172,3 @@ func (dm *DockerManager) GetPodStatus(uid types.UID, name, namespace string) (*k
podStatus
.
ContainerStatuses
=
containerStatuses
podStatus
.
ContainerStatuses
=
containerStatuses
return
podStatus
,
nil
return
podStatus
,
nil
}
}
func
(
dm
*
DockerManager
)
GetPodStatusAndAPIPodStatus
(
pod
*
api
.
Pod
)
(
*
kubecontainer
.
PodStatus
,
*
api
.
PodStatus
,
error
)
{
// Get the pod status.
podStatus
,
err
:=
dm
.
GetPodStatus
(
pod
.
UID
,
pod
.
Name
,
pod
.
Namespace
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
var
apiPodStatus
*
api
.
PodStatus
apiPodStatus
,
err
=
dm
.
ConvertPodStatusToAPIPodStatus
(
pod
,
podStatus
)
return
podStatus
,
apiPodStatus
,
err
}
pkg/kubelet/dockertools/manager_test.go
View file @
f116a5eb
...
@@ -543,10 +543,16 @@ func generatePodInfraContainerHash(pod *api.Pod) uint64 {
...
@@ -543,10 +543,16 @@ func generatePodInfraContainerHash(pod *api.Pod) uint64 {
// runSyncPod is a helper function to retrieve the running pods from the fake
// runSyncPod is a helper function to retrieve the running pods from the fake
// docker client and runs SyncPod for the given pod.
// docker client and runs SyncPod for the given pod.
func
runSyncPod
(
t
*
testing
.
T
,
dm
*
DockerManager
,
fakeDocker
*
FakeDockerClient
,
pod
*
api
.
Pod
,
backOff
*
util
.
Backoff
,
expectErr
bool
)
{
func
runSyncPod
(
t
*
testing
.
T
,
dm
*
DockerManager
,
fakeDocker
*
FakeDockerClient
,
pod
*
api
.
Pod
,
backOff
*
util
.
Backoff
,
expectErr
bool
)
{
podStatus
,
apiPodStatus
,
err
:=
dm
.
GetPodStatusAndAPIPodStatus
(
pod
)
podStatus
,
err
:=
dm
.
GetPodStatus
(
pod
.
UID
,
pod
.
Name
,
pod
.
Namespace
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Errorf
(
"unexpected error: %v"
,
err
)
t
.
Errorf
(
"unexpected error: %v"
,
err
)
}
}
var
apiPodStatus
*
api
.
PodStatus
apiPodStatus
,
err
=
dm
.
ConvertPodStatusToAPIPodStatus
(
pod
,
podStatus
)
if
err
!=
nil
{
t
.
Errorf
(
"unexpected error: %v"
,
err
)
}
fakeDocker
.
ClearCalls
()
fakeDocker
.
ClearCalls
()
if
backOff
==
nil
{
if
backOff
==
nil
{
backOff
=
util
.
NewBackOff
(
time
.
Second
,
time
.
Minute
)
backOff
=
util
.
NewBackOff
(
time
.
Second
,
time
.
Minute
)
...
...
pkg/kubelet/rkt/rkt.go
View file @
f116a5eb
...
@@ -1449,14 +1449,3 @@ func (r *Runtime) ConvertPodStatusToAPIPodStatus(pod *api.Pod, status *kubeconta
...
@@ -1449,14 +1449,3 @@ func (r *Runtime) ConvertPodStatusToAPIPodStatus(pod *api.Pod, status *kubeconta
return
apiPodStatus
,
nil
return
apiPodStatus
,
nil
}
}
// TODO(yifan): Delete this function when the logic is moved to kubelet.
func
(
r
*
Runtime
)
GetPodStatusAndAPIPodStatus
(
pod
*
api
.
Pod
)
(
*
kubecontainer
.
PodStatus
,
*
api
.
PodStatus
,
error
)
{
// Get the pod status.
podStatus
,
err
:=
r
.
GetPodStatus
(
pod
.
UID
,
pod
.
Name
,
pod
.
Namespace
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
apiPodStatus
,
err
:=
r
.
ConvertPodStatusToAPIPodStatus
(
pod
,
podStatus
)
return
podStatus
,
apiPodStatus
,
err
}
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