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
- func GenerateIndexerGRPCRoutebyBackendService(c helpers.ClientReader, logger *slog.Logger) client.IndexerFunc
- func GenerateIndexerGatewayByImplementation(c helpers.ClientReader, controllerName gatewayv1.GatewayController) client.IndexerFunc
- func GenerateIndexerHTTPRouteByBackendService(c helpers.ClientReader, logger *slog.Logger) client.IndexerFunc
- func GenerateIndexerTCPRoutebyBackendService(c helpers.ClientReader, logger *slog.Logger) client.IndexerFunc
- func GenerateIndexerTLSRoutebyBackendService(c helpers.ClientReader, logger *slog.Logger) client.IndexerFunc
- func GenerateIndexerUDPRoutebyBackendService(c helpers.ClientReader, logger *slog.Logger) client.IndexerFunc
- func IndexBTLSPolicyByConfigMap(rawObj client.Object) []string
- func IndexGRPCRouteByBackendServiceImport(rawObj client.Object) []string
- func IndexGRPCRouteByGammaService(rawObj client.Object) []string
- func IndexGRPCRouteByGateway(rawObj client.Object) []string
- func IndexGRPCRouteByListenerSet(rawObj client.Object) []string
- func IndexGatewayBySecret(rawObj client.Object) []string
- func IndexGatewayClassByCiliumGatewayClassConfig(controllerName gatewayv1.GatewayController) client.IndexerFunc
- func IndexHTTPRouteByBackendServiceImport(rawObj client.Object) []string
- func IndexHTTPRouteByGammaService(rawObj client.Object) []string
- func IndexHTTPRouteByGateway(rawObj client.Object) []string
- func IndexHTTPRouteByListenerSet(rawObj client.Object) []string
- func IndexListenerSetByGateway(rawObj client.Object) []string
- func IndexListenerSetBySecret(rawObj client.Object) []string
- func IndexTCPRouteByBackendServiceImport(rawObj client.Object) []string
- func IndexTCPRouteByGateway(rawObj client.Object) []string
- func IndexTCPRouteByListenerSet(rawObj client.Object) []string
- func IndexTLSRouteByBackendServiceImport(rawObj client.Object) []string
- func IndexTLSRouteByGateway(rawObj client.Object) []string
- func IndexTLSRouteByListenerSet(rawObj client.Object) []string
- func IndexUDPRouteByBackendServiceImport(rawObj client.Object) []string
- func IndexUDPRouteByGateway(rawObj client.Object) []string
- func IndexUDPRouteByListenerSet(rawObj client.Object) []string
Constants ¶
const ( // Indexes HTTPRoutes by all the backend Services referenced in the object. BackendServiceHTTPRouteIndex = "BackendServiceHTTPRouteIndex" // Indexes HTTPRoutes by all the backend ServiceImports referenced in the object. BackendServiceImportHTTPRouteIndex = "BackendServiceImportHTTPRouteIndex" // Indexes HTTPRoutes by all the Gateway parents referenced in the object. GatewayHTTPRouteIndex = "gatewayHTTPRouteIndex" // Indexes Gateways and records if the Gateway is relevant for Cilium. ImplementationGatewayIndex = "implementationGatewayIndex" // Indexes TLSRoutes by all the backend Services referenced in the object. BackendServiceTLSRouteIndex = "backendServiceTLSRouteIndex" // Indexes TLSRoutes by all the backend ServiceImports referenced in the object. BackendServiceImportTLSRouteIndex = "backendServiceImportTLSRouteIndex" // Indexes TLSRoutes by all the Gateway parents referenced in the object. GatewayTLSRouteIndex = "gatewayTLSRouteIndex" // Indexes GRPCRoutes by all the backend Services referenced in the object. BackendServiceGRPCRouteIndex = "backendServiceGRPCRouteIndex" // Indexes GRPCRoutes by all the backend ServiceImports referenced in the object. BackendServiceImportGRPCRouteIndex = "BackendServiceImportGRPCRouteIndex" // Indexes GRPCRoutes by all the Gateway parents referenced in the object. GatewayGRPCRouteIndex = "gatewayGRPCRouteIndex" // Indexes BackendTLSPolicies by all the ConfigMaps referenced in the object. BackendTLSPolicyConfigMapIndex = "backendTLSPolicyConfigMaps" // Indexes GAMMA HTTPRoutes by all the GAMMA parents of that HTTPRoute. // This is then be used by the Service reconciler to only retrieve any HTTPRoutes that have that specific // Service as a parent. GammaHTTPRouteParentRefsIndex = "gammaHTTPRouteParentRefs" // Indexes GAMMA GRPCRoutes by all the GAMMA parents of that GRPCRoute. // This is then be used by the Service reconciler to only retrieve any GRPCRoutes that have that specific // Service as a parent. GammaGRPCRouteParentRefsIndex = "gammaGRPCRouteParentRefs" // Indexes GatewayClass objects by the CiliumGatewayClassConfig they reference. GatewayClassCiliumGatewayClassConfigsIndex = "gatewayClassCiliumGatewayClassConfigsIndex" // Indexes TCPRoutes by all the backend Services referenced in the object. BackendServiceTCPRouteIndex = "backendServiceTCPRouteIndex" // Indexes TCPRoutes by all the backend ServiceImports referenced in the object. BackendServiceImportTCPRouteIndex = "backendServiceImportTCPRouteIndex" // Indexes TCPRoutes by all the Gateway parents referenced in the object. GatewayTCPRouteIndex = "gatewayTCPRouteIndex" // Indexes UDPRoutes by all the backend Services referenced in the object. BackendServiceUDPRouteIndex = "backendServiceUDPRouteIndex" // Indexes UDPRoutes by all the backend ServiceImports referenced in the object. BackendServiceImportUDPRouteIndex = "backendServiceImportUDPRouteIndex" // Indexes UDPRoutes by all the Gateway parents referenced in the object. GatewayUDPRouteIndex = "gatewayUDPRouteIndex" // Indexes ListenerSets by the parent Gateway referenced in the object. ListenerSetGatewayIndex = "listenerSetGatewayIndex" // Indexes HTTPRoutes by all the ListenerSet parents referenced in the object. HTTPRouteListenerSetIndex = "listenerSetHTTPRouteIndex" // Indexes GRPCRoutes by all the ListenerSet parents referenced in the object. GRPCRouteListenerSetIndex = "listenerSetGRPCRouteIndex" // Indexes TLSRoutes by all the ListenerSet parents referenced in the object. TLSRouteListenerSetIndex = "listenerSetTLSRouteIndex" // Indexes TCPRoutes by all the ListenerSet parents referenced in the object. TCPRouteListenerSetIndex = "listenerSetTCPRouteIndex" // Indexes UDPRoutes by all the ListenerSet parents referenced in the object. UDPRouteListenerSetIndex = "listenerSetUDPRouteIndex" )
Variables ¶
This section is empty.
Functions ¶
func GenerateIndexerGRPCRoutebyBackendService ¶
func GenerateIndexerGRPCRoutebyBackendService(c helpers.ClientReader, 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 helpers.ClientReader, controllerName gatewayv1.GatewayController) client.IndexerFunc
indexGatewayByImplementation adds the controller name to indexers.ImplementationGatewayIndex if the Gateway has a GatewayClass with that controller name.
func GenerateIndexerHTTPRouteByBackendService ¶
func GenerateIndexerHTTPRouteByBackendService(c helpers.ClientReader, 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 GenerateIndexerTCPRoutebyBackendService ¶ added in v1.20.0
func GenerateIndexerTCPRoutebyBackendService(c helpers.ClientReader, logger *slog.Logger) client.IndexerFunc
GenerateIndexerTCPRoutebyBackendService takes a single TCPRoute and returns all referenced backend service full names (`namespace/name`) to add to the relevant index.
func GenerateIndexerTLSRoutebyBackendService ¶
func GenerateIndexerTLSRoutebyBackendService(c helpers.ClientReader, 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 GenerateIndexerUDPRoutebyBackendService ¶ added in v1.20.0
func GenerateIndexerUDPRoutebyBackendService(c helpers.ClientReader, logger *slog.Logger) client.IndexerFunc
GenerateIndexerUDPRoutebyBackendService takes a single UDPRoute and returns all referenced backend service full names (`namespace/name`) to add to the relevant index.
func IndexBTLSPolicyByConfigMap ¶ added in v1.20.0
func IndexGRPCRouteByBackendServiceImport ¶ added in v1.20.0
IndexGRPCRouteByBackendServiceImport is a client.IndexerFunc that takes a single GRPCRoute and returns all referenced backend ServiceImport 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 IndexGRPCRouteByListenerSet ¶ added in v1.20.0
IndexGRPCRouteByListenerSet indexes GRPCRoutes by all ListenerSet parents referenced in the object, returning ListenerSet full names (`namespace/name`).
func IndexGatewayBySecret ¶ added in v1.20.0
func IndexGatewayClassByCiliumGatewayClassConfig ¶
func IndexGatewayClassByCiliumGatewayClassConfig(controllerName gatewayv1.GatewayController) client.IndexerFunc
IndexGatewayClassByCiliumGatewayClassConfig indexes GatewayClass objects by the referenced CiliumGatewayClassConfig for the given controller.
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 IndexHTTPRouteByListenerSet ¶ added in v1.20.0
IndexHTTPRouteByListenerSet indexes HTTPRoutes by all ListenerSet parents referenced in the object, returning ListenerSet full names (`namespace/name`).
func IndexListenerSetByGateway ¶ added in v1.20.0
IndexListenerSetByGateway is a client.IndexerFunc that takes a single ListenerSet and returns the parent Gateway object full name (`namespace/name`) to add to the relevant index.
func IndexListenerSetBySecret ¶ added in v1.20.0
func IndexTCPRouteByBackendServiceImport ¶ added in v1.20.1
IndexTCPRouteByBackendServiceImport is a client.IndexerFunc that takes a single TCPRoute and returns all referenced backend ServiceImport full names (`namespace/name`) to add to the relevant index.
func IndexTCPRouteByGateway ¶ added in v1.20.0
IndexTCPRouteByGateway takes a single TCPRoute 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 IndexTCPRouteByListenerSet ¶ added in v1.20.0
func IndexTLSRouteByBackendServiceImport ¶ added in v1.20.1
IndexTLSRouteByBackendServiceImport is a client.IndexerFunc that takes a single TLSRoute and returns all referenced backend ServiceImport full names (`namespace/name`) to add to the relevant index.
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.
func IndexTLSRouteByListenerSet ¶ added in v1.20.0
IndexTLSRouteByListenerSet indexes TLSRoutes by all ListenerSet parents referenced in the object, returning ListenerSet full names (`namespace/name`).
func IndexUDPRouteByBackendServiceImport ¶ added in v1.20.1
IndexUDPRouteByBackendServiceImport is a client.IndexerFunc that takes a single UDPRoute and returns all referenced backend ServiceImport full names (`namespace/name`) to add to the relevant index.
func IndexUDPRouteByGateway ¶ added in v1.20.0
IndexUDPRouteByGateway takes a single UDPRoute 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 IndexUDPRouteByListenerSet ¶ added in v1.20.0
Types ¶
This section is empty.