indexers

package
v1.19.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package indexers holds functions related to building indexes for Kubernetes objects in the client cache.

Index functions in this package MUST:

  • return a function with signature `func(rawObj client.Object) []string`, where the `[]string` contains a set of values to index that object by. Generally this should be full names (`namespace/name` of a particular related object type).

An example here is the generateIndexerHTTPRouteByBackendService function, which takes a client.Client and returns a closure that can index HTTPRoutes by the referenced backend service, because ServiceImport support also requires dereferencing a backend Service from annotations on the ServiceImport object.

Index functions in this package that are used in reconcilers MUST also:

  • only operate on a single object (no using a client to GET other objects, for example)

An example here is the indexHTTPRouteByGateway function, which is used in the Gateway reconciler to filter a HTTPRoute List operation so that it only lists HTTPRoutes that have the Gateway under reconciliation as a parent. In order to be able to use the indexer in the tests for the Gateway reconciler, it cannot use a client.Client, as the indexer functions are used to build the fake Client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateIndexerGRPCRoutebyBackendService

func GenerateIndexerGRPCRoutebyBackendService(c client.Client, logger *slog.Logger) client.IndexerFunc

GenerateIndexerGRPCRoutebyBackendService takes a single GRPCRoute and returns all referenced backend service full names (`namespace/name`) to add to the relevant index.

func GenerateIndexerGatewayByImplementation

func GenerateIndexerGatewayByImplementation(c client.Client, controllerName gatewayv1.GatewayController) client.IndexerFunc

indexGatewayByImplementation adds a value of `cilium` to the implementationGatewayIndex if the Gateway has a GatewayClass that has the Cilium `controllerName`.

func GenerateIndexerHTTPRouteByBackendService

func GenerateIndexerHTTPRouteByBackendService(c client.Client, logger *slog.Logger) client.IndexerFunc

GenerateIndexerHTTPRouteByBackendService makes a client.IndexerFunc that takes a single HTTPRoute and returns all referenced backend service full names (`namespace/name`) to add to the relevant index.

func GenerateIndexerTLSRoutebyBackendService

func GenerateIndexerTLSRoutebyBackendService(c client.Client, logger *slog.Logger) client.IndexerFunc

indexTLSRoutebyBackendService takes a single TLSRoute and returns all referenced backend service full names (`namespace/name`) to add to the relevant index.

func IndexGRPCRouteByGammaService added in v1.19.0

func IndexGRPCRouteByGammaService(rawObj client.Object) []string

IndexGRPCRouteByGammaService is a client.IndexerFunc that takes a single GRPCRoute and returns all referenced Service object full names (`namespace/name`) to add to the relevant index.

func IndexGRPCRouteByGateway

func IndexGRPCRouteByGateway(rawObj client.Object) []string

IndexGRPCRouteByGateway is a client.IndexerFunc that takes a single GRPCRoute and returns all referenced Gateway object full names (`namespace/name`) to add to the relevant index.

Note that this does _not_ filter to only Cilium-relevant Gateways.

func IndexHTTPRouteByBackendServiceImport

func IndexHTTPRouteByBackendServiceImport(rawObj client.Object) []string

IndexHTTPRouteByBackendServiceImport is a client.IndexerFunx that takes a single HTTPRoute and returns all referenced backend ServiceImport full names (`namespace/name`) to add to the relevant index.

func IndexHTTPRouteByGammaService added in v1.19.0

func IndexHTTPRouteByGammaService(rawObj client.Object) []string

IndexHTTPRouteByGammaService is a client.IndexerFunc that takes a single HTTPRoute and returns all referenced Service object full names (`namespace/name`) to add to the relevant index.

func IndexHTTPRouteByGateway

func IndexHTTPRouteByGateway(rawObj client.Object) []string

IndexHTTPRouteByGateway is a client.IndexerFunc that takes a single HTTPRoute and returns all referenced Gateway object full names (`namespace/name`) to add to the relevant index.

Note that this does _not_ filter to only Cilium-relevant Gateways.

func IndexTLSRouteByGateway

func IndexTLSRouteByGateway(rawObj client.Object) []string

IndexTLSRouteByGateway takes a single TLSRoute and returns all referenced Gateway object full names (`namespace/name`) to add to the relevant index.

Note that this does _not_ filter to only Cilium-relevant Gateways.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL