Skip to content

Commit

Permalink
Merge pull request #72815 from humblec/md
Browse files Browse the repository at this point in the history
Remove explicit `nil` initialization and correct error strings.
  • Loading branch information
k8s-ci-robot committed Jan 12, 2019
2 parents 7319ace + 11045ca commit 8feab37
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions pkg/controller/endpoint/endpoints_controller.go
Expand Up @@ -428,8 +428,8 @@ func (e *EndpointController) syncService(key string) error {
}

subsets := []v1.EndpointSubset{}
var totalReadyEps int = 0
var totalNotReadyEps int = 0
var totalReadyEps int
var totalNotReadyEps int

for _, pod := range pods {
if len(pod.Status.PodIP) == 0 {
Expand Down Expand Up @@ -559,8 +559,8 @@ func (e *EndpointController) checkLeftoverEndpoints() {

func addEndpointSubset(subsets []v1.EndpointSubset, pod *v1.Pod, epa v1.EndpointAddress,
epp *v1.EndpointPort, tolerateUnreadyEndpoints bool) ([]v1.EndpointSubset, int, int) {
var readyEps int = 0
var notReadyEps int = 0
var readyEps int
var notReadyEps int
ports := []v1.EndpointPort{}
if epp != nil {
ports = append(ports, *epp)
Expand Down
6 changes: 3 additions & 3 deletions pkg/controller/garbagecollector/operations.go
Expand Up @@ -93,11 +93,11 @@ func (gc *GarbageCollector) removeFinalizer(owner *node, targetFinalizer string)
return nil
}
if err != nil {
return fmt.Errorf("cannot finalize owner %s, because cannot get it: %v. The garbage collector will retry later.", owner.identity, err)
return fmt.Errorf("cannot finalize owner %s, because cannot get it: %v. The garbage collector will retry later", owner.identity, err)
}
accessor, err := meta.Accessor(ownerObject)
if err != nil {
return fmt.Errorf("cannot access the owner object %v: %v. The garbage collector will retry later.", ownerObject, err)
return fmt.Errorf("cannot access the owner object %v: %v. The garbage collector will retry later", ownerObject, err)
}
finalizers := accessor.GetFinalizers()
var newFinalizers []string
Expand All @@ -119,7 +119,7 @@ func (gc *GarbageCollector) removeFinalizer(owner *node, targetFinalizer string)
return err
})
if errors.IsConflict(err) {
return fmt.Errorf("updateMaxRetries(%d) has reached. The garbage collector will retry later for owner %v.", retry.DefaultBackoff.Steps, owner.identity)
return fmt.Errorf("updateMaxRetries(%d) has reached. The garbage collector will retry later for owner %v", retry.DefaultBackoff.Steps, owner.identity)
}
return err
}

0 comments on commit 8feab37

Please sign in to comment.