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
348e7ecc
Commit
348e7ecc
authored
Dec 03, 2015
by
Marek Grabowski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #17349 from PeterLamar/master
Small readability improvements in Kubelet
parents
2d4e02b4
aef7af1b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
12 deletions
+6
-12
server.go
cmd/kubelet/app/server.go
+0
-3
kubelet.go
pkg/kubelet/kubelet.go
+6
-9
No files found.
cmd/kubelet/app/server.go
View file @
348e7ecc
...
@@ -17,9 +17,6 @@ limitations under the License.
...
@@ -17,9 +17,6 @@ limitations under the License.
// Package app makes it easy to create a kubelet server for various contexts.
// Package app makes it easy to create a kubelet server for various contexts.
package
app
package
app
// Note: if you change code in this file, you might need to change code in
// contrib/mesos/pkg/executor/service/.
import
(
import
(
"crypto/tls"
"crypto/tls"
"fmt"
"fmt"
...
...
pkg/kubelet/kubelet.go
View file @
348e7ecc
...
@@ -16,9 +16,6 @@ limitations under the License.
...
@@ -16,9 +16,6 @@ limitations under the License.
package
kubelet
package
kubelet
// Note: if you change code in this file, you might need to change code in
// contrib/mesos/pkg/executor/.
import
(
import
(
"bufio"
"bufio"
"bytes"
"bytes"
...
@@ -209,7 +206,7 @@ func NewMainKubelet(
...
@@ -209,7 +206,7 @@ func NewMainKubelet(
configureCBR0
bool
,
configureCBR0
bool
,
podCIDR
string
,
podCIDR
string
,
reconcileCIDR
bool
,
reconcileCIDR
bool
,
p
ods
int
,
maxP
ods
int
,
dockerExecHandler
dockertools
.
ExecHandler
,
dockerExecHandler
dockertools
.
ExecHandler
,
resolverConfig
string
,
resolverConfig
string
,
cpuCFSQuota
bool
,
cpuCFSQuota
bool
,
...
@@ -325,7 +322,7 @@ func NewMainKubelet(
...
@@ -325,7 +322,7 @@ func NewMainKubelet(
writer
:
writer
,
writer
:
writer
,
configureCBR0
:
configureCBR0
,
configureCBR0
:
configureCBR0
,
reconcileCIDR
:
reconcileCIDR
,
reconcileCIDR
:
reconcileCIDR
,
pods
:
p
ods
,
maxPods
:
maxP
ods
,
syncLoopMonitor
:
util
.
AtomicValue
{},
syncLoopMonitor
:
util
.
AtomicValue
{},
resolverConfig
:
resolverConfig
,
resolverConfig
:
resolverConfig
,
cpuCFSQuota
:
cpuCFSQuota
,
cpuCFSQuota
:
cpuCFSQuota
,
...
@@ -633,8 +630,8 @@ type Kubelet struct {
...
@@ -633,8 +630,8 @@ type Kubelet struct {
configureCBR0
bool
configureCBR0
bool
reconcileCIDR
bool
reconcileCIDR
bool
// Number of Pods which can be run by this Kubelet
//
Maximum
Number of Pods which can be run by this Kubelet
p
ods
int
maxP
ods
int
// Monitor Kubelet's sync loop
// Monitor Kubelet's sync loop
syncLoopMonitor
util
.
AtomicValue
syncLoopMonitor
util
.
AtomicValue
...
@@ -2740,7 +2737,7 @@ func (kl *Kubelet) setNodeStatus(node *api.Node) error {
...
@@ -2740,7 +2737,7 @@ func (kl *Kubelet) setNodeStatus(node *api.Node) error {
node
.
Status
.
Capacity
=
api
.
ResourceList
{
node
.
Status
.
Capacity
=
api
.
ResourceList
{
api
.
ResourceCPU
:
*
resource
.
NewMilliQuantity
(
0
,
resource
.
DecimalSI
),
api
.
ResourceCPU
:
*
resource
.
NewMilliQuantity
(
0
,
resource
.
DecimalSI
),
api
.
ResourceMemory
:
resource
.
MustParse
(
"0Gi"
),
api
.
ResourceMemory
:
resource
.
MustParse
(
"0Gi"
),
api
.
ResourcePods
:
*
resource
.
NewQuantity
(
int64
(
kl
.
p
ods
),
resource
.
DecimalSI
),
api
.
ResourcePods
:
*
resource
.
NewQuantity
(
int64
(
kl
.
maxP
ods
),
resource
.
DecimalSI
),
}
}
glog
.
Errorf
(
"Error getting machine info: %v"
,
err
)
glog
.
Errorf
(
"Error getting machine info: %v"
,
err
)
}
else
{
}
else
{
...
@@ -2748,7 +2745,7 @@ func (kl *Kubelet) setNodeStatus(node *api.Node) error {
...
@@ -2748,7 +2745,7 @@ func (kl *Kubelet) setNodeStatus(node *api.Node) error {
node
.
Status
.
NodeInfo
.
SystemUUID
=
info
.
SystemUUID
node
.
Status
.
NodeInfo
.
SystemUUID
=
info
.
SystemUUID
node
.
Status
.
Capacity
=
cadvisor
.
CapacityFromMachineInfo
(
info
)
node
.
Status
.
Capacity
=
cadvisor
.
CapacityFromMachineInfo
(
info
)
node
.
Status
.
Capacity
[
api
.
ResourcePods
]
=
*
resource
.
NewQuantity
(
node
.
Status
.
Capacity
[
api
.
ResourcePods
]
=
*
resource
.
NewQuantity
(
int64
(
kl
.
p
ods
),
resource
.
DecimalSI
)
int64
(
kl
.
maxP
ods
),
resource
.
DecimalSI
)
if
node
.
Status
.
NodeInfo
.
BootID
!=
""
&&
if
node
.
Status
.
NodeInfo
.
BootID
!=
""
&&
node
.
Status
.
NodeInfo
.
BootID
!=
info
.
BootID
{
node
.
Status
.
NodeInfo
.
BootID
!=
info
.
BootID
{
// TODO: This requires a transaction, either both node status is updated
// TODO: This requires a transaction, either both node status is updated
...
...
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