diff --git a/internal/provider/kubernetes/controller_offline.go b/internal/provider/kubernetes/controller_offline.go index f3bcdf15aa..bd13320c93 100644 --- a/internal/provider/kubernetes/controller_offline.go +++ b/internal/provider/kubernetes/controller_offline.go @@ -159,17 +159,23 @@ func newOfflineGatewayAPIClient(extensionPolicies []schema.GroupVersionKind) cli WithScheme(scheme). WithIndex(&gwapiv1.Gateway{}, classGatewayIndex, gatewayIndexFunc). WithIndex(&gwapiv1.Gateway{}, secretGatewayIndex, secretGatewayIndexFunc). + WithIndex(&gwapiv1.ListenerSet{}, gatewayListenerSetIndex, gatewayListenerSetIndexFunc). WithIndex(&gwapiv1.HTTPRoute{}, gatewayHTTPRouteIndex, gatewayHTTPRouteIndexFunc). WithIndex(&gwapiv1.HTTPRoute{}, backendHTTPRouteIndex, backendHTTPRouteIndexFunc). + WithIndex(&gwapiv1.HTTPRoute{}, listenerSetHTTPRouteIndex, listenerSetHTTPRouteIndexFunc). WithIndex(&gwapiv1.HTTPRoute{}, httpRouteFilterHTTPRouteIndex, httpRouteFilterHTTPRouteIndexFunc). WithIndex(&gwapiv1.GRPCRoute{}, gatewayGRPCRouteIndex, gatewayGRPCRouteIndexFunc). WithIndex(&gwapiv1.GRPCRoute{}, backendGRPCRouteIndex, backendGRPCRouteIndexFunc). + WithIndex(&gwapiv1.GRPCRoute{}, listenerSetGRPCRouteIndex, listenerSetGRPCRouteIndexFunc). WithIndex(&gwapiv1a2.TCPRoute{}, gatewayTCPRouteIndex, gatewayTCPRouteIndexFunc). WithIndex(&gwapiv1a2.TCPRoute{}, backendTCPRouteIndex, backendTCPRouteIndexFunc). + WithIndex(&gwapiv1a2.TCPRoute{}, listenerSetTCPRouteIndex, listenerSetTCPRouteIndexFunc). WithIndex(&gwapiv1a2.UDPRoute{}, gatewayUDPRouteIndex, gatewayUDPRouteIndexFunc). WithIndex(&gwapiv1a2.UDPRoute{}, backendUDPRouteIndex, backendUDPRouteIndexFunc). + WithIndex(&gwapiv1a2.UDPRoute{}, listenerSetUDPRouteIndex, listenerSetUDPRouteIndexFunc). WithIndex(&gwapiv1.TLSRoute{}, gatewayTLSRouteIndex, gatewayTLSRouteIndexFunc). WithIndex(&gwapiv1.TLSRoute{}, backendTLSRouteIndex, backendTLSRouteIndexFunc). + WithIndex(&gwapiv1.TLSRoute{}, listenerSetTLSRouteIndex, listenerSetTLSRouteIndexFunc). WithIndex(&egv1a1.EnvoyProxy{}, backendEnvoyProxyTelemetryIndex, backendEnvoyProxyTelemetryIndexFunc). WithIndex(&egv1a1.EnvoyProxy{}, secretEnvoyProxyIndex, secretEnvoyProxyIndexFunc). WithIndex(&egv1a1.BackendTrafficPolicy{}, configMapBtpIndex, configMapBtpIndexFunc). @@ -182,6 +188,7 @@ func newOfflineGatewayAPIClient(extensionPolicies []schema.GroupVersionKind) cli WithIndex(&egv1a1.EnvoyExtensionPolicy{}, backendEnvoyExtensionPolicyIndex, backendEnvoyExtensionPolicyIndexFunc). WithIndex(&egv1a1.EnvoyExtensionPolicy{}, secretEnvoyExtensionPolicyIndex, secretEnvoyExtensionPolicyIndexFunc). WithIndex(&egv1a1.EnvoyExtensionPolicy{}, configMapEepIndex, configMapEepIndexFunc). + WithIndex(&egv1a1.EnvoyExtensionPolicy{}, clusterTrustBundleEepIndex, clusterTrustBundleEepIndexFunc). WithIndex(&gwapiv1.BackendTLSPolicy{}, configMapBtlsIndex, configMapBtlsIndexFunc). WithIndex(&gwapiv1.BackendTLSPolicy{}, secretBtlsIndex, secretBtlsIndexFunc). WithIndex(&gwapiv1.BackendTLSPolicy{}, clusterTrustBundleBtlsIndex, clusterTrustBundleBtlsIndexFunc). diff --git a/internal/provider/kubernetes/controller_offline_test.go b/internal/provider/kubernetes/controller_offline_test.go index f64a29ce39..8f6198890a 100644 --- a/internal/provider/kubernetes/controller_offline_test.go +++ b/internal/provider/kubernetes/controller_offline_test.go @@ -141,11 +141,18 @@ func TestNewOfflineGatewayAPIControllerIndexRegistration(t *testing.T) { require.NoError(t, err) }) + t.Run("ListenerSet index", func(t *testing.T) { + err := cli.List(context.Background(), &gwapiv1.ListenerSetList{}, client.MatchingFields{gatewayListenerSetIndex: "any"}) + require.NoError(t, err) + }) + t.Run("HTTPRoute indices", func(t *testing.T) { err := cli.List(context.Background(), &gwapiv1.HTTPRouteList{}, client.MatchingFields{gatewayHTTPRouteIndex: "any"}) require.NoError(t, err) err = cli.List(context.Background(), &gwapiv1.HTTPRouteList{}, client.MatchingFields{backendHTTPRouteIndex: "any"}) require.NoError(t, err) + err = cli.List(context.Background(), &gwapiv1.HTTPRouteList{}, client.MatchingFields{listenerSetHTTPRouteIndex: "any"}) + require.NoError(t, err) err = cli.List(context.Background(), &gwapiv1.HTTPRouteList{}, client.MatchingFields{httpRouteFilterHTTPRouteIndex: "any"}) require.NoError(t, err) }) @@ -155,6 +162,8 @@ func TestNewOfflineGatewayAPIControllerIndexRegistration(t *testing.T) { require.NoError(t, err) err = cli.List(context.Background(), &gwapiv1.GRPCRouteList{}, client.MatchingFields{backendGRPCRouteIndex: "any"}) require.NoError(t, err) + err = cli.List(context.Background(), &gwapiv1.GRPCRouteList{}, client.MatchingFields{listenerSetGRPCRouteIndex: "any"}) + require.NoError(t, err) }) t.Run("TCPRoute indices", func(t *testing.T) { @@ -162,6 +171,8 @@ func TestNewOfflineGatewayAPIControllerIndexRegistration(t *testing.T) { require.NoError(t, err) err = cli.List(context.Background(), &gwapiv1a2.TCPRouteList{}, client.MatchingFields{backendTCPRouteIndex: "any"}) require.NoError(t, err) + err = cli.List(context.Background(), &gwapiv1a2.TCPRouteList{}, client.MatchingFields{listenerSetTCPRouteIndex: "any"}) + require.NoError(t, err) }) t.Run("UDPRoute indices", func(t *testing.T) { @@ -169,6 +180,8 @@ func TestNewOfflineGatewayAPIControllerIndexRegistration(t *testing.T) { require.NoError(t, err) err = cli.List(context.Background(), &gwapiv1a2.UDPRouteList{}, client.MatchingFields{backendUDPRouteIndex: "any"}) require.NoError(t, err) + err = cli.List(context.Background(), &gwapiv1a2.UDPRouteList{}, client.MatchingFields{listenerSetUDPRouteIndex: "any"}) + require.NoError(t, err) }) t.Run("TLSRoute indices", func(t *testing.T) { @@ -176,6 +189,8 @@ func TestNewOfflineGatewayAPIControllerIndexRegistration(t *testing.T) { require.NoError(t, err) err = cli.List(context.Background(), &gwapiv1.TLSRouteList{}, client.MatchingFields{backendTLSRouteIndex: "any"}) require.NoError(t, err) + err = cli.List(context.Background(), &gwapiv1.TLSRouteList{}, client.MatchingFields{listenerSetTLSRouteIndex: "any"}) + require.NoError(t, err) }) t.Run("EnvoyProxy indices", func(t *testing.T) { @@ -215,6 +230,8 @@ func TestNewOfflineGatewayAPIControllerIndexRegistration(t *testing.T) { require.NoError(t, err) err = cli.List(context.Background(), &egv1a1.EnvoyExtensionPolicyList{}, client.MatchingFields{configMapEepIndex: "any"}) require.NoError(t, err) + err = cli.List(context.Background(), &egv1a1.EnvoyExtensionPolicyList{}, client.MatchingFields{clusterTrustBundleEepIndex: "any"}) + require.NoError(t, err) }) t.Run("BackendTLSPolicy indices", func(t *testing.T) { diff --git a/release-notes/current/bug_fixes/9320-offline-controller-listenerset-indexes.md b/release-notes/current/bug_fixes/9320-offline-controller-listenerset-indexes.md new file mode 100644 index 0000000000..da8d964506 --- /dev/null +++ b/release-notes/current/bug_fixes/9320-offline-controller-listenerset-indexes.md @@ -0,0 +1 @@ +Fixed the standalone offline controller used by the File provider to register the missing ListenerSet, ListenerSet-owned route, and ClusterTrustBundle EnvoyExtensionPolicy indexes so reconciliation no longer fails with unregistered index errors.