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
de0957cc
Commit
de0957cc
authored
Apr 28, 2015
by
Victor Marmol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create Kubelet types package for common shared types.
parent
3c0b7992
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
64 additions
and
26 deletions
+64
-26
docker.go
pkg/kubelet/dockertools/docker.go
+3
-5
manager.go
pkg/kubelet/dockertools/manager.go
+5
-4
kubelet.go
pkg/kubelet/kubelet.go
+10
-9
exec.go
pkg/kubelet/network/exec/exec.go
+3
-3
plugins.go
pkg/kubelet/network/plugins.go
+5
-5
doc.go
pkg/kubelet/types/doc.go
+18
-0
docker.go
pkg/kubelet/types/docker.go
+20
-0
No files found.
pkg/kubelet/dockertools/docker.go
View file @
de0957cc
...
@@ -29,6 +29,7 @@ import (
...
@@ -29,6 +29,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/credentialprovider"
"github.com/GoogleCloudPlatform/kubernetes/pkg/credentialprovider"
kubecontainer
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/container"
kubecontainer
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/container"
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/leaky"
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/leaky"
kubeletTypes
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/types"
"github.com/GoogleCloudPlatform/kubernetes/pkg/types"
"github.com/GoogleCloudPlatform/kubernetes/pkg/types"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/docker/docker/pkg/parsers"
"github.com/docker/docker/pkg/parsers"
...
@@ -68,9 +69,6 @@ type DockerInterface interface {
...
@@ -68,9 +69,6 @@ type DockerInterface interface {
StartExec
(
string
,
docker
.
StartExecOptions
)
error
StartExec
(
string
,
docker
.
StartExecOptions
)
error
}
}
// DockerID is an ID of docker container. It is a type to make it clear when we're working with docker container Ids
type
DockerID
string
// KubeletContainerName encapsulates a pod name and a Kubernetes container name.
// KubeletContainerName encapsulates a pod name and a Kubernetes container name.
type
KubeletContainerName
struct
{
type
KubeletContainerName
struct
{
PodFullName
string
PodFullName
string
...
@@ -174,7 +172,7 @@ func (p throttledDockerPuller) IsImagePresent(name string) (bool, error) {
...
@@ -174,7 +172,7 @@ func (p throttledDockerPuller) IsImagePresent(name string) (bool, error) {
}
}
// DockerContainers is a map of containers
// DockerContainers is a map of containers
type
DockerContainers
map
[
DockerID
]
*
docker
.
APIContainers
type
DockerContainers
map
[
kubeletTypes
.
DockerID
]
*
docker
.
APIContainers
func
(
c
DockerContainers
)
FindPodContainer
(
podFullName
string
,
uid
types
.
UID
,
containerName
string
)
(
*
docker
.
APIContainers
,
bool
,
uint64
)
{
func
(
c
DockerContainers
)
FindPodContainer
(
podFullName
string
,
uid
types
.
UID
,
containerName
string
)
(
*
docker
.
APIContainers
,
bool
,
uint64
)
{
for
_
,
dockerContainer
:=
range
c
{
for
_
,
dockerContainer
:=
range
c
{
...
@@ -319,7 +317,7 @@ func GetKubeletDockerContainers(client DockerInterface, allContainers bool) (Doc
...
@@ -319,7 +317,7 @@ func GetKubeletDockerContainers(client DockerInterface, allContainers bool) (Doc
glog
.
V
(
3
)
.
Infof
(
"Docker Container: %s is not managed by kubelet."
,
container
.
Names
[
0
])
glog
.
V
(
3
)
.
Infof
(
"Docker Container: %s is not managed by kubelet."
,
container
.
Names
[
0
])
continue
continue
}
}
result
[
DockerID
(
container
.
ID
)]
=
container
result
[
kubeletTypes
.
DockerID
(
container
.
ID
)]
=
container
}
}
return
result
,
nil
return
result
,
nil
}
}
pkg/kubelet/dockertools/manager.go
View file @
de0957cc
...
@@ -34,6 +34,7 @@ import (
...
@@ -34,6 +34,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/capabilities"
"github.com/GoogleCloudPlatform/kubernetes/pkg/capabilities"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client/record"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client/record"
kubecontainer
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/container"
kubecontainer
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/container"
kubeletTypes
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/types"
"github.com/GoogleCloudPlatform/kubernetes/pkg/types"
"github.com/GoogleCloudPlatform/kubernetes/pkg/types"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/fsouza/go-dockerclient"
"github.com/fsouza/go-dockerclient"
...
@@ -988,7 +989,7 @@ func (dm *DockerManager) KillContainer(containerID types.UID) error {
...
@@ -988,7 +989,7 @@ func (dm *DockerManager) KillContainer(containerID types.UID) error {
}
}
// Run a single container from a pod. Returns the docker container ID
// Run a single container from a pod. Returns the docker container ID
func
(
dm
*
DockerManager
)
RunContainer
(
pod
*
api
.
Pod
,
container
*
api
.
Container
,
generator
kubecontainer
.
RunContainerOptionsGenerator
,
runner
kubecontainer
.
HandlerRunner
,
netMode
,
ipcMode
string
)
(
DockerID
,
error
)
{
func
(
dm
*
DockerManager
)
RunContainer
(
pod
*
api
.
Pod
,
container
*
api
.
Container
,
generator
kubecontainer
.
RunContainerOptionsGenerator
,
runner
kubecontainer
.
HandlerRunner
,
netMode
,
ipcMode
string
)
(
kubeletTypes
.
DockerID
,
error
)
{
ref
,
err
:=
kubecontainer
.
GenerateContainerRef
(
pod
,
container
)
ref
,
err
:=
kubecontainer
.
GenerateContainerRef
(
pod
,
container
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"Couldn't make a ref to pod %v, container %v: '%v'"
,
pod
.
Name
,
container
.
Name
,
err
)
glog
.
Errorf
(
"Couldn't make a ref to pod %v, container %v: '%v'"
,
pod
.
Name
,
container
.
Name
,
err
)
...
@@ -1013,7 +1014,7 @@ func (dm *DockerManager) RunContainer(pod *api.Pod, container *api.Container, ge
...
@@ -1013,7 +1014,7 @@ func (dm *DockerManager) RunContainer(pod *api.Pod, container *api.Container, ge
handlerErr
:=
runner
.
Run
(
id
,
pod
,
container
,
container
.
Lifecycle
.
PostStart
)
handlerErr
:=
runner
.
Run
(
id
,
pod
,
container
,
container
.
Lifecycle
.
PostStart
)
if
handlerErr
!=
nil
{
if
handlerErr
!=
nil
{
dm
.
KillContainer
(
types
.
UID
(
id
))
dm
.
KillContainer
(
types
.
UID
(
id
))
return
DockerID
(
""
),
fmt
.
Errorf
(
"failed to call event handler: %v"
,
handlerErr
)
return
kubeletTypes
.
DockerID
(
""
),
fmt
.
Errorf
(
"failed to call event handler: %v"
,
handlerErr
)
}
}
}
}
...
@@ -1027,11 +1028,11 @@ func (dm *DockerManager) RunContainer(pod *api.Pod, container *api.Container, ge
...
@@ -1027,11 +1028,11 @@ func (dm *DockerManager) RunContainer(pod *api.Pod, container *api.Container, ge
if
err
=
dm
.
os
.
Symlink
(
containerLogFile
,
symlinkFile
);
err
!=
nil
{
if
err
=
dm
.
os
.
Symlink
(
containerLogFile
,
symlinkFile
);
err
!=
nil
{
glog
.
Errorf
(
"Failed to create symbolic link to the log file of pod %q container %q: %v"
,
podFullName
,
container
.
Name
,
err
)
glog
.
Errorf
(
"Failed to create symbolic link to the log file of pod %q container %q: %v"
,
podFullName
,
container
.
Name
,
err
)
}
}
return
DockerID
(
id
),
err
return
kubeletTypes
.
DockerID
(
id
),
err
}
}
// CreatePodInfraContainer starts the pod infra container for a pod. Returns the docker container ID of the newly created container.
// CreatePodInfraContainer starts the pod infra container for a pod. Returns the docker container ID of the newly created container.
func
(
dm
*
DockerManager
)
CreatePodInfraContainer
(
pod
*
api
.
Pod
,
generator
kubecontainer
.
RunContainerOptionsGenerator
,
runner
kubecontainer
.
HandlerRunner
)
(
DockerID
,
error
)
{
func
(
dm
*
DockerManager
)
CreatePodInfraContainer
(
pod
*
api
.
Pod
,
generator
kubecontainer
.
RunContainerOptionsGenerator
,
runner
kubecontainer
.
HandlerRunner
)
(
kubeletTypes
.
DockerID
,
error
)
{
// Use host networking if specified.
// Use host networking if specified.
netNamespace
:=
""
netNamespace
:=
""
var
ports
[]
api
.
ContainerPort
var
ports
[]
api
.
ContainerPort
...
...
pkg/kubelet/kubelet.go
View file @
de0957cc
...
@@ -43,6 +43,7 @@ import (
...
@@ -43,6 +43,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/envvars"
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/envvars"
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/metrics"
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/metrics"
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/network"
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/network"
kubeletTypes
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/types"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/probe"
"github.com/GoogleCloudPlatform/kubernetes/pkg/probe"
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
...
@@ -892,7 +893,7 @@ func (kl *Kubelet) killPod(pod kubecontainer.Pod) error {
...
@@ -892,7 +893,7 @@ func (kl *Kubelet) killPod(pod kubecontainer.Pod) error {
errList
:=
[]
error
{}
errList
:=
[]
error
{}
if
err
==
nil
{
if
err
==
nil
{
// Call the networking plugin for teardown.
// Call the networking plugin for teardown.
err
=
kl
.
networkPlugin
.
TearDownPod
(
pod
.
Namespace
,
pod
.
Name
,
dockertool
s
.
DockerID
(
container
.
ID
))
err
=
kl
.
networkPlugin
.
TearDownPod
(
pod
.
Namespace
,
pod
.
Name
,
kubeletType
s
.
DockerID
(
container
.
ID
))
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"Failed tearing down the network plugin for pod %q: %v"
,
pod
.
ID
,
err
)
glog
.
Errorf
(
"Failed tearing down the network plugin for pod %q: %v"
,
pod
.
ID
,
err
)
errList
=
append
(
errList
,
err
)
errList
=
append
(
errList
,
err
)
...
@@ -973,9 +974,9 @@ func shouldContainerBeRestarted(container *api.Container, pod *api.Pod, podStatu
...
@@ -973,9 +974,9 @@ func shouldContainerBeRestarted(container *api.Container, pod *api.Pod, podStatu
// - all running containers which are NOT contained in containersToKeep should be killed.
// - all running containers which are NOT contained in containersToKeep should be killed.
type
podContainerChangesSpec
struct
{
type
podContainerChangesSpec
struct
{
startInfraContainer
bool
startInfraContainer
bool
infraContainerId
dockertool
s
.
DockerID
infraContainerId
kubeletType
s
.
DockerID
containersToStart
map
[
int
]
empty
containersToStart
map
[
int
]
empty
containersToKeep
map
[
dockertool
s
.
DockerID
]
int
containersToKeep
map
[
kubeletType
s
.
DockerID
]
int
}
}
func
(
kl
*
Kubelet
)
computePodContainerChanges
(
pod
*
api
.
Pod
,
runningPod
kubecontainer
.
Pod
,
podStatus
api
.
PodStatus
)
(
podContainerChangesSpec
,
error
)
{
func
(
kl
*
Kubelet
)
computePodContainerChanges
(
pod
*
api
.
Pod
,
runningPod
kubecontainer
.
Pod
,
podStatus
api
.
PodStatus
)
(
podContainerChangesSpec
,
error
)
{
...
@@ -984,11 +985,11 @@ func (kl *Kubelet) computePodContainerChanges(pod *api.Pod, runningPod kubeconta
...
@@ -984,11 +985,11 @@ func (kl *Kubelet) computePodContainerChanges(pod *api.Pod, runningPod kubeconta
glog
.
V
(
4
)
.
Infof
(
"Syncing Pod %+v, podFullName: %q, uid: %q"
,
pod
,
podFullName
,
uid
)
glog
.
V
(
4
)
.
Infof
(
"Syncing Pod %+v, podFullName: %q, uid: %q"
,
pod
,
podFullName
,
uid
)
containersToStart
:=
make
(
map
[
int
]
empty
)
containersToStart
:=
make
(
map
[
int
]
empty
)
containersToKeep
:=
make
(
map
[
dockertool
s
.
DockerID
]
int
)
containersToKeep
:=
make
(
map
[
kubeletType
s
.
DockerID
]
int
)
createPodInfraContainer
:=
false
createPodInfraContainer
:=
false
var
err
error
var
err
error
var
podInfraContainerID
dockertool
s
.
DockerID
var
podInfraContainerID
kubeletType
s
.
DockerID
var
changed
bool
var
changed
bool
podInfraContainer
:=
runningPod
.
FindContainerByName
(
dockertools
.
PodInfraContainerName
)
podInfraContainer
:=
runningPod
.
FindContainerByName
(
dockertools
.
PodInfraContainerName
)
if
podInfraContainer
!=
nil
{
if
podInfraContainer
!=
nil
{
...
@@ -1007,7 +1008,7 @@ func (kl *Kubelet) computePodContainerChanges(pod *api.Pod, runningPod kubeconta
...
@@ -1007,7 +1008,7 @@ func (kl *Kubelet) computePodContainerChanges(pod *api.Pod, runningPod kubeconta
}
else
{
}
else
{
glog
.
V
(
4
)
.
Infof
(
"Pod infra container looks good, keep it %q"
,
podFullName
)
glog
.
V
(
4
)
.
Infof
(
"Pod infra container looks good, keep it %q"
,
podFullName
)
createPodInfraContainer
=
false
createPodInfraContainer
=
false
podInfraContainerID
=
dockertool
s
.
DockerID
(
podInfraContainer
.
ID
)
podInfraContainerID
=
kubeletType
s
.
DockerID
(
podInfraContainer
.
ID
)
containersToKeep
[
podInfraContainerID
]
=
-
1
containersToKeep
[
podInfraContainerID
]
=
-
1
}
}
...
@@ -1026,7 +1027,7 @@ func (kl *Kubelet) computePodContainerChanges(pod *api.Pod, runningPod kubeconta
...
@@ -1026,7 +1027,7 @@ func (kl *Kubelet) computePodContainerChanges(pod *api.Pod, runningPod kubeconta
continue
continue
}
}
containerID
:=
dockertool
s
.
DockerID
(
c
.
ID
)
containerID
:=
kubeletType
s
.
DockerID
(
c
.
ID
)
hash
:=
c
.
Hash
hash
:=
c
.
Hash
glog
.
V
(
3
)
.
Infof
(
"pod %q container %q exists as %v"
,
podFullName
,
container
.
Name
,
containerID
)
glog
.
V
(
3
)
.
Infof
(
"pod %q container %q exists as %v"
,
podFullName
,
container
.
Name
,
containerID
)
...
@@ -1074,7 +1075,7 @@ func (kl *Kubelet) computePodContainerChanges(pod *api.Pod, runningPod kubeconta
...
@@ -1074,7 +1075,7 @@ func (kl *Kubelet) computePodContainerChanges(pod *api.Pod, runningPod kubeconta
// If Infra container is the last running one, we don't want to keep it.
// If Infra container is the last running one, we don't want to keep it.
if
!
createPodInfraContainer
&&
len
(
containersToStart
)
==
0
&&
len
(
containersToKeep
)
==
1
{
if
!
createPodInfraContainer
&&
len
(
containersToStart
)
==
0
&&
len
(
containersToKeep
)
==
1
{
containersToKeep
=
make
(
map
[
dockertool
s
.
DockerID
]
int
)
containersToKeep
=
make
(
map
[
kubeletType
s
.
DockerID
]
int
)
}
}
return
podContainerChangesSpec
{
return
podContainerChangesSpec
{
...
@@ -1147,7 +1148,7 @@ func (kl *Kubelet) syncPod(pod *api.Pod, mirrorPod *api.Pod, runningPod kubecont
...
@@ -1147,7 +1148,7 @@ func (kl *Kubelet) syncPod(pod *api.Pod, mirrorPod *api.Pod, runningPod kubecont
}
else
{
}
else
{
// Otherwise kill any containers in this pod which are not specified as ones to keep.
// Otherwise kill any containers in this pod which are not specified as ones to keep.
for
_
,
container
:=
range
runningPod
.
Containers
{
for
_
,
container
:=
range
runningPod
.
Containers
{
_
,
keep
:=
containerChanges
.
containersToKeep
[
dockertool
s
.
DockerID
(
container
.
ID
)]
_
,
keep
:=
containerChanges
.
containersToKeep
[
kubeletType
s
.
DockerID
(
container
.
ID
)]
if
!
keep
{
if
!
keep
{
glog
.
V
(
3
)
.
Infof
(
"Killing unwanted container %+v"
,
container
)
glog
.
V
(
3
)
.
Infof
(
"Killing unwanted container %+v"
,
container
)
err
=
kl
.
containerManager
.
KillContainer
(
container
.
ID
)
err
=
kl
.
containerManager
.
KillContainer
(
container
.
ID
)
...
...
pkg/kubelet/network/exec/exec.go
View file @
de0957cc
...
@@ -54,8 +54,8 @@ import (
...
@@ -54,8 +54,8 @@ import (
"path"
"path"
"strings"
"strings"
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/dockertools"
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/network"
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/network"
kubeletTypes
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/types"
utilexec
"github.com/GoogleCloudPlatform/kubernetes/pkg/util/exec"
utilexec
"github.com/GoogleCloudPlatform/kubernetes/pkg/util/exec"
"github.com/golang/glog"
"github.com/golang/glog"
)
)
...
@@ -125,13 +125,13 @@ func (plugin *execNetworkPlugin) validate() error {
...
@@ -125,13 +125,13 @@ func (plugin *execNetworkPlugin) validate() error {
return
nil
return
nil
}
}
func
(
plugin
*
execNetworkPlugin
)
SetUpPod
(
namespace
string
,
name
string
,
id
dockertool
s
.
DockerID
)
error
{
func
(
plugin
*
execNetworkPlugin
)
SetUpPod
(
namespace
string
,
name
string
,
id
kubeletType
s
.
DockerID
)
error
{
out
,
err
:=
utilexec
.
New
()
.
Command
(
plugin
.
getExecutable
(),
setUpCmd
,
namespace
,
name
,
string
(
id
))
.
CombinedOutput
()
out
,
err
:=
utilexec
.
New
()
.
Command
(
plugin
.
getExecutable
(),
setUpCmd
,
namespace
,
name
,
string
(
id
))
.
CombinedOutput
()
glog
.
V
(
5
)
.
Infof
(
"SetUpPod 'exec' network plugin output: %s, %v"
,
string
(
out
),
err
)
glog
.
V
(
5
)
.
Infof
(
"SetUpPod 'exec' network plugin output: %s, %v"
,
string
(
out
),
err
)
return
err
return
err
}
}
func
(
plugin
*
execNetworkPlugin
)
TearDownPod
(
namespace
string
,
name
string
,
id
dockertool
s
.
DockerID
)
error
{
func
(
plugin
*
execNetworkPlugin
)
TearDownPod
(
namespace
string
,
name
string
,
id
kubeletType
s
.
DockerID
)
error
{
out
,
err
:=
utilexec
.
New
()
.
Command
(
plugin
.
getExecutable
(),
tearDownCmd
,
namespace
,
name
,
string
(
id
))
.
CombinedOutput
()
out
,
err
:=
utilexec
.
New
()
.
Command
(
plugin
.
getExecutable
(),
tearDownCmd
,
namespace
,
name
,
string
(
id
))
.
CombinedOutput
()
glog
.
V
(
5
)
.
Infof
(
"TearDownPod 'exec' network plugin output: %s, %v"
,
string
(
out
),
err
)
glog
.
V
(
5
)
.
Infof
(
"TearDownPod 'exec' network plugin output: %s, %v"
,
string
(
out
),
err
)
return
err
return
err
...
...
pkg/kubelet/network/plugins.go
View file @
de0957cc
...
@@ -22,7 +22,7 @@ import (
...
@@ -22,7 +22,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/dockertool
s"
kubeletTypes
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/type
s"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util/errors"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util/errors"
"github.com/golang/glog"
"github.com/golang/glog"
...
@@ -43,10 +43,10 @@ type NetworkPlugin interface {
...
@@ -43,10 +43,10 @@ type NetworkPlugin interface {
// SetUpPod is the method called after the infra container of
// SetUpPod is the method called after the infra container of
// the pod has been created but before the other containers of the
// the pod has been created but before the other containers of the
// pod are launched.
// pod are launched.
SetUpPod
(
namespace
string
,
name
string
,
podInfraContainerID
dockertool
s
.
DockerID
)
error
SetUpPod
(
namespace
string
,
name
string
,
podInfraContainerID
kubeletType
s
.
DockerID
)
error
// TearDownPod is the method called before a pod's infra container will be deleted
// TearDownPod is the method called before a pod's infra container will be deleted
TearDownPod
(
namespace
string
,
name
string
,
podInfraContainerID
dockertool
s
.
DockerID
)
error
TearDownPod
(
namespace
string
,
name
string
,
podInfraContainerID
kubeletType
s
.
DockerID
)
error
}
}
// Host is an interface that plugins can use to access the kubelet.
// Host is an interface that plugins can use to access the kubelet.
...
@@ -113,10 +113,10 @@ func (plugin *noopNetworkPlugin) Name() string {
...
@@ -113,10 +113,10 @@ func (plugin *noopNetworkPlugin) Name() string {
return
DefaultPluginName
return
DefaultPluginName
}
}
func
(
plugin
*
noopNetworkPlugin
)
SetUpPod
(
namespace
string
,
name
string
,
id
dockertool
s
.
DockerID
)
error
{
func
(
plugin
*
noopNetworkPlugin
)
SetUpPod
(
namespace
string
,
name
string
,
id
kubeletType
s
.
DockerID
)
error
{
return
nil
return
nil
}
}
func
(
plugin
*
noopNetworkPlugin
)
TearDownPod
(
namespace
string
,
name
string
,
id
dockertool
s
.
DockerID
)
error
{
func
(
plugin
*
noopNetworkPlugin
)
TearDownPod
(
namespace
string
,
name
string
,
id
kubeletType
s
.
DockerID
)
error
{
return
nil
return
nil
}
}
pkg/kubelet/types/doc.go
0 → 100644
View file @
de0957cc
/*
Copyright 2015 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Common types in the Kubelet.
package
types
pkg/kubelet/types/docker.go
0 → 100644
View file @
de0957cc
/*
Copyright 2015 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
types
// DockerID is an ID of docker container. It is a type to make it clear when we're working with docker container Ids
type
DockerID
string
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