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 ¶
- func GenerateIndexerGRPCRoutebyBackendService(c client.Client, logger *slog.Logger) client.IndexerFunc
- func GenerateIndexerGatewayByImplementation(c client.Client, controllerName gatewayv1.GatewayController) client.IndexerFunc
- func GenerateIndexerHTTPRouteByBackendService(c client.Client, logger *slog.Logger) client.IndexerFunc
- func GenerateIndexerTLSRoutebyBackendService(c client.Client, logger *slog.Logger) client.IndexerFunc
- func IndexGRPCRouteByGammaService(rawObj client.Object) []string
- func IndexGRPCRouteByGateway(rawObj client.Object) []string
- func IndexHTTPRouteByBackendServiceImport(rawObj client.Object) []string
- func IndexHTTPRouteByGammaService(rawObj client.Object) []string
- func IndexHTTPRouteByGateway(rawObj client.Object) []string
- func IndexTLSRouteByGateway(rawObj client.Object) []string
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
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 ¶
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 ¶
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
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 ¶
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 ¶
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.