Skip to content

Commit 888cbb9

Browse files
committed
FIXME Review Continued (nginx#692)
1 parent 4cfa0b6 commit 888cbb9

File tree

4 files changed

+8
-19
lines changed

4 files changed

+8
-19
lines changed

internal/manager/manager.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ func Start(cfg config.Config) error {
7070

7171
// Note: for any new object type or a change to the existing one,
7272
// make sure to also update prepareFirstEventBatchPreparerArgs()
73-
// FIXME(pleshakov): Make the comment above redundant.
7473
controllerRegCfgs := []struct {
7574
objectType client.Object
7675
options []controller.Option

internal/status/gateway.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ import (
1010
)
1111

1212
// prepareGatewayStatus prepares the status for a Gateway resource.
13-
// FIXME(pleshakov): Be compliant with in the Gateway API.
14-
// Currently, we only support simple valid/invalid status per each listener.
15-
// Extend support to cover more cases.
1613
func prepareGatewayStatus(
1714
gatewayStatus state.GatewayStatus,
1815
podIP string,
@@ -21,6 +18,7 @@ func prepareGatewayStatus(
2118
listenerStatuses := make([]v1beta1.ListenerStatus, 0, len(gatewayStatus.ListenerStatuses))
2219

2320
// FIXME(pleshakov) Maintain the order from the Gateway resource
21+
// https://github.com/nginxinc/nginx-kubernetes-gateway/issues/689
2422
names := make([]string, 0, len(gatewayStatus.ListenerStatuses))
2523
for name := range gatewayStatus.ListenerStatuses {
2624
names = append(names, name)
@@ -34,7 +32,9 @@ func prepareGatewayStatus(
3432
Name: v1beta1.SectionName(name),
3533
SupportedKinds: []v1beta1.RouteGroupKind{
3634
{
37-
Kind: "HTTPRoute", // FIXME(pleshakov) Set it based on the listener
35+
// FIXME(pleshakov) Set it based on the listener
36+
// https://github.com/nginxinc/nginx-kubernetes-gateway/issues/690
37+
Kind: "HTTPRoute",
3838
},
3939
},
4040
AttachedRoutes: s.AttachedRoutes,

internal/status/httproute.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ import (
88
)
99

1010
// prepareHTTPRouteStatus prepares the status for an HTTPRoute resource.
11-
// FIXME(pleshakov): Be compliant with in the Gateway API.
12-
// Currently, we only support simple attached/not attached status per each parentRef.
13-
// Extend support to cover more cases.
1411
func prepareHTTPRouteStatus(
1512
status state.HTTPRouteStatus,
1613
gatewayCtlrName string,

internal/status/updater.go

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,37 +44,32 @@ type UpdaterConfig struct {
4444
//
4545
// (1) It doesn't understand the leader election. Only the leader must report the statuses of the resources. Otherwise,
4646
// multiple replicas will step on each other when trying to report statuses for the same resources.
47-
// FIXME(pleshakov): address limitation (1)
4847
//
4948
// (2) It is not smart. It will update the status of a resource (make an API call) even if it hasn't changed.
50-
// FIXME(pleshakov) address limitation (2)
5149
//
5250
// (3) It is synchronous, which means the status reporter can slow down the event loop.
5351
// Consider the following cases:
5452
// (a) Sometimes the Gateway will need to update statuses of all resources it handles, which could be ~1000. Making 1000
5553
// status API calls sequentially will take time.
5654
// (b) k8s API can become slow or even timeout. This will increase every update status API call.
5755
// Making updaterImpl asynchronous will prevent it from adding variable delays to the event loop.
58-
// FIXME(pleshakov) address limitation (3)
5956
//
6057
// (4) It doesn't retry on failures. This means there is a chance that some resources will not have up-to-do statuses.
6158
// Statuses are important part of the Gateway API, so we need to ensure that the Gateway always keep the resources
6259
// statuses up-to-date.
63-
// FIXME(pleshakov): address limitation (4)
6460
//
6561
// (5) It doesn't clear the statuses of a resources that are no longer handled by the Gateway. For example, if
6662
// an HTTPRoute resource no longer has the parentRef to the Gateway resources, the Gateway must update the status
6763
// of the resource to remove the status about the removed parentRef.
68-
// FIXME(pleshakov): address limitation (5)
6964
//
7065
// (6) If another controllers changes the status of the Gateway/HTTPRoute resource so that the information set by our
7166
// Gateway is removed, our Gateway will not restore the status until the EventLoop invokes the StatusUpdater as a
7267
// result of processing some other new change to a resource(s).
73-
// FIXME(pleshakov): Figure out if this is something that needs to be addressed.
68+
// FIXME(pleshakov): Make updater production ready
69+
// https://github.com/nginxinc/nginx-kubernetes-gateway/issues/691
7470

75-
// (7) To support new resources, updaterImpl needs to be modified. Consider making updaterImpl extendable, so that it
71+
// To support new resources, updaterImpl needs to be modified. Consider making updaterImpl extendable, so that it
7672
// goes along the Open-closed principle.
77-
// FIXME(pleshakov): address limitation (7)
7873
type updaterImpl struct {
7974
cfg UpdaterConfig
8075
}
@@ -88,7 +83,7 @@ func NewUpdater(cfg UpdaterConfig) Updater {
8883

8984
func (upd *updaterImpl) Update(ctx context.Context, statuses state.Statuses) {
9085
// FIXME(pleshakov) Merge the new Conditions in the status with the existing Conditions
91-
// FIXME(pleshakov) Skip the status update (API call) if the status hasn't changed.
86+
// https://github.com/nginxinc/nginx-kubernetes-gateway/issues/558
9287

9388
if upd.cfg.UpdateGatewayClassStatus && statuses.GatewayClassStatus != nil {
9489
upd.update(
@@ -135,8 +130,6 @@ func (upd *updaterImpl) update(
135130
statusSetter func(client.Object),
136131
) {
137132
// The function handles errors by reporting them in the logs.
138-
// FIXME(pleshakov): figure out appropriate log level for these errors. Perhaps 3?
139-
140133
// We need to get the latest version of the resource.
141134
// Otherwise, the Update status API call can fail.
142135
// Note: the default client uses a cache for reads, so we're not making an unnecessary API call here.

0 commit comments

Comments
 (0)