Skip to content

Commit 1a0f923

Browse files
authored
Merge pull request kubernetes#87712 from alena1108/jan30kubelet
Ineffassign fixes for pkg/controller and kubelet
2 parents b290e0b + 6c3093f commit 1a0f923

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

pkg/controller/podautoscaler/horizontal.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -937,15 +937,13 @@ func convertDesiredReplicasWithRules(currentReplicas, desiredReplicas, hpaMinRep
937937
var possibleLimitingReason string
938938

939939
minimumAllowedReplicas = hpaMinReplicas
940-
possibleLimitingReason = "the desired replica count is less than the minimum replica count"
941940

942941
// Do not upscale too much to prevent incorrect rapid increase of the number of master replicas caused by
943942
// bogus CPU usage report from heapster/kubelet (like in issue #32304).
944943
scaleUpLimit := calculateScaleUpLimit(currentReplicas)
945944

946945
if hpaMaxReplicas > scaleUpLimit {
947946
maximumAllowedReplicas = scaleUpLimit
948-
949947
possibleLimitingCondition = "ScaleUpLimit"
950948
possibleLimitingReason = "the desired replica count is increasing faster than the maximum scale rate"
951949
} else {

pkg/kubelet/cm/container_manager_windows.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,14 @@ func (cm *containerManagerImpl) Start(node *v1.Node,
7676

7777
// NewContainerManager creates windows container manager.
7878
func NewContainerManager(mountUtil mount.Interface, cadvisorInterface cadvisor.Interface, nodeConfig NodeConfig, failSwapOn bool, devicePluginEnabled bool, recorder record.EventRecorder) (ContainerManager, error) {
79-
var capacity = v1.ResourceList{}
8079
// It is safe to invoke `MachineInfo` on cAdvisor before logically initializing cAdvisor here because
8180
// machine info is computed and cached once as part of cAdvisor object creation.
8281
// But `RootFsInfo` and `ImagesFsInfo` are not available at this moment so they will be called later during manager starts
8382
machineInfo, err := cadvisorInterface.MachineInfo()
8483
if err != nil {
8584
return nil, err
8685
}
87-
capacity = cadvisor.CapacityFromMachineInfo(machineInfo)
86+
capacity := cadvisor.CapacityFromMachineInfo(machineInfo)
8887

8988
return &containerManagerImpl{
9089
capacity: capacity,

0 commit comments

Comments
 (0)