mirror of https://github.com/k3s-io/k3s
Merge pull request #72815 from humblec/md
Remove explicit `nil` initialization and correct error strings.pull/564/head
commit
8feab37d41
|
@ -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 {
|
||||
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue