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
b4d5177c
Commit
b4d5177c
authored
Sep 19, 2016
by
Kubernetes Submit Queue
Committed by
GitHub
Sep 19, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #32816 from pmorie/kubelet-godoc
Automatic merge from submit-queue Add missing kubelet godoc Adds some missing godoc to Kubelet, which I found while triaging a bug.
parents
aa60583e
703cc164
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
kubelet.go
pkg/kubelet/kubelet.go
+13
-1
No files found.
pkg/kubelet/kubelet.go
View file @
b4d5177c
...
@@ -233,6 +233,8 @@ type KubeletDeps struct {
...
@@ -233,6 +233,8 @@ type KubeletDeps struct {
TLSOptions
*
server
.
TLSOptions
TLSOptions
*
server
.
TLSOptions
}
}
// makePodSourceConfig creates a config.PodConfig from the given
// KubeletConfiguration or returns an error.
func
makePodSourceConfig
(
kubeCfg
*
componentconfig
.
KubeletConfiguration
,
kubeDeps
*
KubeletDeps
,
nodeName
string
)
(
*
config
.
PodConfig
,
error
)
{
func
makePodSourceConfig
(
kubeCfg
*
componentconfig
.
KubeletConfiguration
,
kubeDeps
*
KubeletDeps
,
nodeName
string
)
(
*
config
.
PodConfig
,
error
)
{
manifestURLHeader
:=
make
(
http
.
Header
)
manifestURLHeader
:=
make
(
http
.
Header
)
if
kubeCfg
.
ManifestURLHeader
!=
""
{
if
kubeCfg
.
ManifestURLHeader
!=
""
{
...
@@ -1319,6 +1321,8 @@ func makePortMappings(container *api.Container) (ports []kubecontainer.PortMappi
...
@@ -1319,6 +1321,8 @@ func makePortMappings(container *api.Container) (ports []kubecontainer.PortMappi
return
return
}
}
// GeneratePodHostNameAndDomain creates a hostname and domain name for a pod,
// given that pod's spec and annotations or returns an error.
func
(
kl
*
Kubelet
)
GeneratePodHostNameAndDomain
(
pod
*
api
.
Pod
)
(
string
,
string
,
error
)
{
func
(
kl
*
Kubelet
)
GeneratePodHostNameAndDomain
(
pod
*
api
.
Pod
)
(
string
,
string
,
error
)
{
// TODO(vmarmol): Handle better.
// TODO(vmarmol): Handle better.
// Cap hostname at 63 chars (specification is 64bytes which is 63 chars and the null terminating char).
// Cap hostname at 63 chars (specification is 64bytes which is 63 chars and the null terminating char).
...
@@ -1413,7 +1417,8 @@ func (kl *Kubelet) GenerateRunContainerOptions(pod *api.Pod, container *api.Cont
...
@@ -1413,7 +1417,8 @@ func (kl *Kubelet) GenerateRunContainerOptions(pod *api.Pod, container *api.Cont
var
masterServices
=
sets
.
NewString
(
"kubernetes"
)
var
masterServices
=
sets
.
NewString
(
"kubernetes"
)
// getServiceEnvVarMap makes a map[string]string of env vars for services a pod in namespace ns should see
// getServiceEnvVarMap makes a map[string]string of env vars for services a
// pod in namespace ns should see.
func
(
kl
*
Kubelet
)
getServiceEnvVarMap
(
ns
string
)
(
map
[
string
]
string
,
error
)
{
func
(
kl
*
Kubelet
)
getServiceEnvVarMap
(
ns
string
)
(
map
[
string
]
string
,
error
)
{
var
(
var
(
serviceMap
=
make
(
map
[
string
]
api
.
Service
)
serviceMap
=
make
(
map
[
string
]
api
.
Service
)
...
@@ -2795,6 +2800,8 @@ func (kl *Kubelet) convertStatusToAPIStatus(pod *api.Pod, podStatus *kubecontain
...
@@ -2795,6 +2800,8 @@ func (kl *Kubelet) convertStatusToAPIStatus(pod *api.Pod, podStatus *kubecontain
return
&
apiPodStatus
return
&
apiPodStatus
}
}
// convertToAPIContainerStatuses converts the given internal container
// statuses into API container statuses.
func
(
kl
*
Kubelet
)
convertToAPIContainerStatuses
(
pod
*
api
.
Pod
,
podStatus
*
kubecontainer
.
PodStatus
,
previousStatus
[]
api
.
ContainerStatus
,
containers
[]
api
.
Container
,
hasInitContainers
,
isInitContainer
bool
)
[]
api
.
ContainerStatus
{
func
(
kl
*
Kubelet
)
convertToAPIContainerStatuses
(
pod
*
api
.
Pod
,
podStatus
*
kubecontainer
.
PodStatus
,
previousStatus
[]
api
.
ContainerStatus
,
containers
[]
api
.
Container
,
hasInitContainers
,
isInitContainer
bool
)
[]
api
.
ContainerStatus
{
convertContainerStatus
:=
func
(
cs
*
kubecontainer
.
ContainerStatus
)
*
api
.
ContainerStatus
{
convertContainerStatus
:=
func
(
cs
*
kubecontainer
.
ContainerStatus
)
*
api
.
ContainerStatus
{
cid
:=
cs
.
ID
.
String
()
cid
:=
cs
.
ID
.
String
()
...
@@ -3057,6 +3064,8 @@ func isSyncPodWorthy(event *pleg.PodLifecycleEvent) bool {
...
@@ -3057,6 +3064,8 @@ func isSyncPodWorthy(event *pleg.PodLifecycleEvent) bool {
return
event
.
Type
!=
pleg
.
ContainerRemoved
return
event
.
Type
!=
pleg
.
ContainerRemoved
}
}
// parseResourceList parses the given configuration map into an API
// ResourceList or returns an error.
func
parseResourceList
(
m
utilconfig
.
ConfigurationMap
)
(
api
.
ResourceList
,
error
)
{
func
parseResourceList
(
m
utilconfig
.
ConfigurationMap
)
(
api
.
ResourceList
,
error
)
{
rl
:=
make
(
api
.
ResourceList
)
rl
:=
make
(
api
.
ResourceList
)
for
k
,
v
:=
range
m
{
for
k
,
v
:=
range
m
{
...
@@ -3078,6 +3087,9 @@ func parseResourceList(m utilconfig.ConfigurationMap) (api.ResourceList, error)
...
@@ -3078,6 +3087,9 @@ func parseResourceList(m utilconfig.ConfigurationMap) (api.ResourceList, error)
return
rl
,
nil
return
rl
,
nil
}
}
// ParseReservation parses the given kubelet- and system- reservations
// configuration maps into an internal Reservation instance or returns an
// error.
func
ParseReservation
(
kubeReserved
,
systemReserved
utilconfig
.
ConfigurationMap
)
(
*
kubetypes
.
Reservation
,
error
)
{
func
ParseReservation
(
kubeReserved
,
systemReserved
utilconfig
.
ConfigurationMap
)
(
*
kubetypes
.
Reservation
,
error
)
{
reservation
:=
new
(
kubetypes
.
Reservation
)
reservation
:=
new
(
kubetypes
.
Reservation
)
if
rl
,
err
:=
parseResourceList
(
kubeReserved
);
err
!=
nil
{
if
rl
,
err
:=
parseResourceList
(
kubeReserved
);
err
!=
nil
{
...
...
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