Skip to content

Commit

Permalink
chore(controllers) fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rainest committed Jun 1, 2022
1 parent 7fed2b0 commit a3f70ca
Showing 3 changed files with 25 additions and 32 deletions.
7 changes: 3 additions & 4 deletions hack/generators/controllers/networking/main.go
Original file line number Diff line number Diff line change
@@ -490,8 +490,8 @@ func (r *{{.PackageAlias}}{{.Kind}}Reconciler) listClassless(obj client.Object)
return nil
}
var recs []reconcile.Request
for _, resource := range resourceList.Items {
if ctrlutils.IsIngressClassEmpty(&resource) {
for i, resource := range resourceList.Items {
if ctrlutils.IsIngressClassEmpty(&resourceList.Items[i]) {
recs = append(recs, reconcile.Request{
NamespacedName: types.NamespacedName{
Namespace: resource.Namespace,
@@ -579,9 +579,8 @@ func (r *{{.PackageAlias}}{{.Kind}}Reconciler) Reconcile(ctx context.Context, re
if len(obj.Status.LoadBalancer.Ingress) != len(addrs) || !reflect.DeepEqual(obj.Status.LoadBalancer.Ingress, addrs) {
obj.Status.LoadBalancer.Ingress = addrs
return ctrl.Result{}, r.Status().Update(ctx, obj)
} else {
log.V(util.DebugLevel).Info("status update not needed", "namespace", req.Namespace, "name", req.Name)
}
log.V(util.DebugLevel).Info("status update not needed", "namespace", req.Namespace, "name", req.Name)
}
{{- end}}
43 changes: 19 additions & 24 deletions internal/controllers/configuration/zz_generated_controllers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions internal/controllers/knative/knative.go
Original file line number Diff line number Diff line change
@@ -92,8 +92,8 @@ func (r *Knativev1alpha1IngressReconciler) listClassless(obj client.Object) []re
return nil
}
var recs []reconcile.Request
for _, resource := range resourceList.Items {
if ctrlutils.IsIngressClassEmpty(&resource) {
for i, resource := range resourceList.Items {
if ctrlutils.IsIngressClassEmpty(&resourceList.Items[i]) {
recs = append(recs, reconcile.Request{
NamespacedName: types.NamespacedName{
Namespace: resource.Namespace,
@@ -188,9 +188,8 @@ func (r *Knativev1alpha1IngressReconciler) Reconcile(ctx context.Context, req ct
ingressCondSet.Manage(&obj.Status).MarkTrue(knativev1alpha1.IngressConditionNetworkConfigured)
obj.Status.ObservedGeneration = obj.Generation
return ctrl.Result{}, r.Status().Update(ctx, obj)
} else {
log.V(util.DebugLevel).Info("status update not needed", "namespace", req.Namespace, "name", req.Name)
}
log.V(util.DebugLevel).Info("status update not needed", "namespace", req.Namespace, "name", req.Name)
}

return ctrl.Result{}, nil

0 comments on commit a3f70ca

Please sign in to comment.