mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-11 22:20:18 +00:00
Clean up error logs.
Use %v for errors, tidy some messages, make error messages start lowe-case (as per go guidelines). Just accumulated nits.
This commit is contained in:
@@ -434,7 +434,7 @@ func ValidateService(service *api.Service, lister ServiceLister, ctx api.Context
|
||||
if services.Items[i].Name != service.Name &&
|
||||
services.Items[i].Spec.CreateExternalLoadBalancer &&
|
||||
services.Items[i].Spec.Port == service.Spec.Port {
|
||||
allErrs = append(allErrs, errs.NewConflict("service", service.Name, fmt.Errorf("Port: %d is already in use", service.Spec.Port)))
|
||||
allErrs = append(allErrs, errs.NewConflict("service", service.Name, fmt.Errorf("port: %d is already in use", service.Spec.Port)))
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -548,7 +548,7 @@ func ValidateMinionUpdate(oldMinion *api.Minion, minion *api.Minion) errs.Valida
|
||||
oldMinion.Labels = minion.Labels
|
||||
oldMinion.ObjectMeta.Labels = minion.ObjectMeta.Labels
|
||||
if !reflect.DeepEqual(oldMinion, minion) {
|
||||
allErrs = append(allErrs, fmt.Errorf("Update contains more than labels changes"))
|
||||
allErrs = append(allErrs, fmt.Errorf("update contains more than labels changes"))
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
|
@@ -805,7 +805,7 @@ func TestValidateService(t *testing.T) {
|
||||
registry.List = tc.existing
|
||||
errs := ValidateService(&tc.svc, registry, api.NewDefaultContext())
|
||||
if len(errs) != tc.numErrs {
|
||||
t.Errorf("Unexpected error list for case %q: %+v", tc.name, errs)
|
||||
t.Errorf("Unexpected error list for case %q: %v", tc.name, errs.ToError())
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user