Skip to content

Commit cc58eb8

Browse files
committed
resolve comments
1 parent 6bcdf4c commit cc58eb8

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

internal/controller/httproutepolicy.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,8 @@ func (r *HTTPRouteReconciler) processHTTPRoutePolicies(tctx *provider.TranslateC
8181
err := fmt.Errorf("unsupported object type %T", obj)
8282
panic(err)
8383
}
84-
tCopy := t.DeepCopy()
85-
tCopy.Status = policy.Status
86-
return tCopy
84+
t.Status = policy.Status
85+
return t
8786
}),
8887
})
8988
}
@@ -160,9 +159,8 @@ func (r *IngressReconciler) processHTTPRoutePolicies(tctx *provider.TranslateCon
160159
err := fmt.Errorf("unsupported object type %T", obj)
161160
panic(err)
162161
}
163-
tCopy := t.DeepCopy()
164-
tCopy.Status = policy.Status
165-
return tCopy
162+
t.Status = policy.Status
163+
return t
166164
}),
167165
})
168166
}

internal/controller/policies.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,8 @@ func ProcessBackendTrafficPolicy(
157157
err := fmt.Errorf("unsupported object type %T", obj)
158158
panic(err)
159159
}
160-
tCopy := t.DeepCopy()
161-
tCopy.Status = policy.Status
162-
return tCopy
160+
t.Status = policy.Status
161+
return t
163162
}),
164163
})
165164
}

internal/controller/status/updater.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import (
2323
"sigs.k8s.io/controller-runtime/pkg/client"
2424
)
2525

26+
const UpdateChannelBufferSize = 1000
27+
2628
type Update struct {
2729
NamespacedName types.NamespacedName
2830
Resource client.Object
@@ -54,7 +56,7 @@ func NewStatusUpdateHandler(log logr.Logger, client client.Client) *UpdateHandle
5456
u := &UpdateHandler{
5557
log: log,
5658
client: client,
57-
updateChannel: make(chan Update, 1000),
59+
updateChannel: make(chan Update, UpdateChannelBufferSize),
5860
wg: new(sync.WaitGroup),
5961
}
6062

0 commit comments

Comments
 (0)