You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit addresses an issue where the autoneg controller would fail
to reconcile backend services when the Network Endpoint Group (NEG)
status annotation was empty. This scenario typically occurs if the
GKE NEG controller has not yet provisioned the NEGs for a service.
The root cause was that an empty backend service name was being used in
the request to the Google Cloud Compute API. This caused the API to
treat the 'get' request as a 'list' request, leading to a JSON
unmarshaling error due to the different response format. This error
prevented the controller from removing finalizers on services marked
for deletion, causing namespaces to become stuck.
The following changes have been made:
- Updated `ReconcileBackends` in `controllers/autoneg.go` to
handle cases where the upsert backend service name is empty,
preventing calls to `getBackendService` with an empty name.
- Added `context.Context` propagation through `ReconcileBackends`.
- Added a new unit test, `TestReconcileBackendsDeletionWithEmptyNEGStatus`,
in `controllers/autoneg_test.go` to specifically cover the error scenario.
- Updated function signatures and calls in `controllers/service_controller.go`
and `controllers/suite_test.go` to align with the changes in the `BackendController` interface.
0 commit comments