indexer

package
v1.8.6 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventsByInvolvedObjectAPIGroupField = "involvedObject.apiGroup"

	FreightByWarehouseField       = "warehouse"
	FreightByCurrentStagesField   = "currentlyIn"
	FreightByVerifiedStagesField  = "verifiedIn"
	FreightApprovedForStagesField = "approvedFor"

	PromotionsByStageAndFreightField = "stageAndFreight"
	PromotionsByStageField           = "stage"
	PromotionsByTerminalField        = "terminal"

	RunningPromotionsByArgoCDApplicationsField = "applications"

	StagesByAnalysisRunField    = "analysisRun"
	StagesByFreightField        = "freight"
	StagesByUpstreamStagesField = "upstreamStages"
	StagesByWarehouseField      = "warehouse"

	ServiceAccountsByOIDCClaimsField = "claims"

	WarehousesBySubscribedURLsField           = "subscribedURLs"
	ProjectConfigsByWebhookReceiverPathsField = "receiverPaths"
)

Variables

This section is empty.

Functions

func EventsByInvolvedObjectAPIGroup

func EventsByInvolvedObjectAPIGroup(obj client.Object) []string

EventsByInvolvedObjectAPIGroup is a client.IndexerFunc that indexes Events by the API group of the involved object.

func FormatClaim

func FormatClaim(claimName, claimValue string) string

FormatClaim formats a claims name and values to be used by the IndexServiceAccountsByOIDCClaims index.

func FreightApprovedForStages

func FreightApprovedForStages(obj client.Object) []string

FreightApprovedForStages is a client.IndexerFunc that indexes Freight by the Stages for which it has been (manually) approved.

func FreightByCurrentStages

func FreightByCurrentStages(obj client.Object) []string

FreightByCurrentStages is a client.IndexerFunc that indexes Freight by the Stages in which it is currently in use.

func FreightByVerifiedStages

func FreightByVerifiedStages(obj client.Object) []string

FreightByVerifiedStages is a client.IndexerFunc that indexes Freight by the Stages in which it has been verified.

func FreightByWarehouse

func FreightByWarehouse(obj client.Object) []string

FreightByWarehouse is a client.IndexerFunc that indexes Freight by the Warehouse it is associated with.

func ProjectConfigsByWebhookReceiverPaths

func ProjectConfigsByWebhookReceiverPaths(obj client.Object) []string

ProjectConfigsByWebhookReceiverPaths is a client.IndexerFunc that indexes Projects by the paths of their receivers.

func PromotionsByStage

func PromotionsByStage(obj client.Object) []string

PromotionsByStage returns a client.IndexerFunc that indexes Promotions by the Stage they reference.

func PromotionsByStageAndFreight

func PromotionsByStageAndFreight(obj client.Object) []string

PromotionsByStageAndFreight is a client.IndexerFunc that indexes Promotions by the Freight and Stage they reference.

func PromotionsByTerminal

func PromotionsByTerminal(obj client.Object) []string

PromotionsByTerminal returns a client.IndexerFunc that indexes Promotions by whether or not that are in a terminal phase.

func RunningPromotionsByArgoCDApplications

func RunningPromotionsByArgoCDApplications(
	ctx context.Context,
	cl client.Client,
	shardName string,
	isDefaultController bool,
) client.IndexerFunc

RunningPromotionsByArgoCDApplications returns a client.IndexerFunc that indexes running Promotions by the Argo CD Applications they are associated with.

When the provided shardName is non-empty, only Promotions labeled with the provided shardName are indexed. When the provided shardName is empty, only Promotions not labeled with a shardName are indexed.

func ServiceAccountsByOIDCClaims

func ServiceAccountsByOIDCClaims(obj client.Object) []string

ServiceAccountsByOIDCClaims is a client.IndexerFunc that indexes ServiceAccounts by their OIDC claims.

func StageAndFreightKey

func StageAndFreightKey(stage, freight string) string

StageAndFreightKey returns a key that uniquely identifies a Stage and Freight.

func StagesByAnalysisRun

func StagesByAnalysisRun(
	shardName string,
	isDefaultController bool,
) client.IndexerFunc

StagesByAnalysisRun is a client.IndexerFunc that indexes Stages by the AnalysisRun they are associated with.

func StagesByFreight

func StagesByFreight(obj client.Object) []string

StagesByFreight is a client.IndexerFunc that indexes Stages by the Freight they reference.

func StagesByUpstreamStages

func StagesByUpstreamStages(obj client.Object) []string

StagesByUpstreamStages is a client.IndexerFunc that indexes Stages by the upstream Stages they reference.

func StagesByWarehouse

func StagesByWarehouse(obj client.Object) []string

StagesByWarehouse is a client.IndexerFunc that indexes Stages by the Warehouse they are associated with.

func WarehousesBySubscribedURLs

func WarehousesBySubscribedURLs(obj client.Object) []string

WarehousesBySubscribedURLs is a client.IndexerFunc that indexes Warehouses by the repositories they subscribe to.

Types

type SharedFieldIndexer

type SharedFieldIndexer struct {
	// contains filtered or unexported fields
}

SharedFieldIndexer is a wrapper around a client.FieldIndexer that ensures that the same field is not indexed multiple times.

This is useful when multiple reconcilers require the same index, but want to continue to manage their own indices.

func NewSharedFieldIndexer

func NewSharedFieldIndexer(indexer client.FieldIndexer) *SharedFieldIndexer

NewSharedFieldIndexer returns a new SharedFieldIndexer.

func (*SharedFieldIndexer) IndexField

func (i *SharedFieldIndexer) IndexField(
	ctx context.Context,
	obj client.Object,
	field string,
	extractValue client.IndexerFunc,
) error

IndexField indexes the given field on the given object using the underlying client.FieldIndexer. If the field has already been indexed for the given object type, it will not be indexed again.

Jump to

Keyboard shortcuts

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