Skip to content

Commit

Permalink
Merge pull request kubernetes#17349 from PeterLamar/master
Browse files Browse the repository at this point in the history
Small readability improvements in Kubelet
  • Loading branch information
Marek Grabowski committed Dec 3, 2015
2 parents 2d4e02b + aef7af1 commit 348e7ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
3 changes: 0 additions & 3 deletions cmd/kubelet/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ limitations under the License.
// Package app makes it easy to create a kubelet server for various contexts.
package app

// Note: if you change code in this file, you might need to change code in
// contrib/mesos/pkg/executor/service/.

import (
"crypto/tls"
"fmt"
Expand Down
15 changes: 6 additions & 9 deletions pkg/kubelet/kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ limitations under the License.

package kubelet

// Note: if you change code in this file, you might need to change code in
// contrib/mesos/pkg/executor/.

import (
"bufio"
"bytes"
Expand Down Expand Up @@ -209,7 +206,7 @@ func NewMainKubelet(
configureCBR0 bool,
podCIDR string,
reconcileCIDR bool,
pods int,
maxPods int,
dockerExecHandler dockertools.ExecHandler,
resolverConfig string,
cpuCFSQuota bool,
Expand Down Expand Up @@ -325,7 +322,7 @@ func NewMainKubelet(
writer: writer,
configureCBR0: configureCBR0,
reconcileCIDR: reconcileCIDR,
pods: pods,
maxPods: maxPods,
syncLoopMonitor: util.AtomicValue{},
resolverConfig: resolverConfig,
cpuCFSQuota: cpuCFSQuota,
Expand Down Expand Up @@ -633,8 +630,8 @@ type Kubelet struct {
configureCBR0 bool
reconcileCIDR bool

// Number of Pods which can be run by this Kubelet
pods int
// Maximum Number of Pods which can be run by this Kubelet
maxPods int

// Monitor Kubelet's sync loop
syncLoopMonitor util.AtomicValue
Expand Down Expand Up @@ -2740,15 +2737,15 @@ func (kl *Kubelet) setNodeStatus(node *api.Node) error {
node.Status.Capacity = api.ResourceList{
api.ResourceCPU: *resource.NewMilliQuantity(0, resource.DecimalSI),
api.ResourceMemory: resource.MustParse("0Gi"),
api.ResourcePods: *resource.NewQuantity(int64(kl.pods), resource.DecimalSI),
api.ResourcePods: *resource.NewQuantity(int64(kl.maxPods), resource.DecimalSI),
}
glog.Errorf("Error getting machine info: %v", err)
} else {
node.Status.NodeInfo.MachineID = info.MachineID
node.Status.NodeInfo.SystemUUID = info.SystemUUID
node.Status.Capacity = cadvisor.CapacityFromMachineInfo(info)
node.Status.Capacity[api.ResourcePods] = *resource.NewQuantity(
int64(kl.pods), resource.DecimalSI)
int64(kl.maxPods), resource.DecimalSI)
if node.Status.NodeInfo.BootID != "" &&
node.Status.NodeInfo.BootID != info.BootID {
// TODO: This requires a transaction, either both node status is updated
Expand Down

0 comments on commit 348e7ec

Please sign in to comment.