indexer

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventsByInvolvedObjectAPIGroupField = "involvedObject.apiGroup"

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

	PromotionsByStageAndFreightField = "stageAndFreight"
	PromotionsByStageField           = "stage"

	RunningPromotionsByArgoCDApplicationsField = "applications"

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

	ServiceAccountsByOIDCClaimsField = "claims"
)

Variables

This section is empty.

Functions

func EventsByInvolvedObjectAPIGroup added in v1.1.0

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 string, claimValue string) string

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

func FreightApprovedForStages added in v1.1.0

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 FreightByVerifiedStages added in v1.1.0

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 added in v1.1.0

func FreightByWarehouse(obj client.Object) []string

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

func PromotionsByStage added in v1.1.0

func PromotionsByStage(obj client.Object) []string

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

func PromotionsByStageAndFreight added in v1.1.0

func PromotionsByStageAndFreight(obj client.Object) []string

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

func RunningPromotionsByArgoCDApplications added in v1.1.0

func RunningPromotionsByArgoCDApplications(
	ctx context.Context,
	shardName string,
) 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 added in v1.1.0

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 added in v1.1.0

func StagesByAnalysisRun(shardName string) client.IndexerFunc

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

func StagesByFreight added in v1.1.0

func StagesByFreight(obj client.Object) []string

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

func StagesByUpstreamStages added in v1.1.0

func StagesByUpstreamStages(obj client.Object) []string

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

func StagesByWarehouse added in v1.1.0

func StagesByWarehouse(obj client.Object) []string

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

Types

type SharedFieldIndexer added in v1.1.0

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 added in v1.1.0

func NewSharedFieldIndexer(indexer client.FieldIndexer) *SharedFieldIndexer

NewSharedFieldIndexer returns a new SharedFieldIndexer.

func (*SharedFieldIndexer) IndexField added in v1.1.0

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