Documentation
¶
Overview ¶
Package index defines field indexes for artifact CRDs.
Index ¶
Constants ¶
const ( // ConfigMapOnRulesfile is the index field name for Rulesfile resources indexed by their ConfigMapRef. ConfigMapOnRulesfile = "ConfigMapOnRulesfile" // SecretOnRulesfile is the index field name for Rulesfile resources indexed by their SecretRef. SecretOnRulesfile = "SecretOnRulesfile" )
const ConfigMapOnConfig = "ConfigMapOnConfig"
ConfigMapOnConfig is the index field name for Config resources indexed by their ConfigMapRef.
const SecretOnPlugin = "SecretOnPlugin"
SecretOnPlugin is the index field name for Plugin resources indexed by their SecretRef.
Variables ¶
var All []Entry = append(append(ConfigIndexes, RulesfileIndexes...), PluginIndexes...)
All aggregates all field indexes defined in this package.
var ConfigByConfigMapRef = IndexByConfigMapRef( func(c *artifactv1alpha1.Config) *commonv1alpha1.ConfigMapRef { return c.Spec.ConfigMapRef }, )
ConfigByConfigMapRef indexes Config resources by their .spec.configMapRef.name.
var ConfigIndexes = []Entry{ { Object: &artifactv1alpha1.Config{}, Field: ConfigMapOnConfig, ExtractValueFn: ConfigByConfigMapRef, }, }
ConfigIndexes holds all field indexes for Config resources.
var PluginBySecretRef = IndexBySecretRef( func(pl *artifactv1alpha1.Plugin) *commonv1alpha1.SecretRef { if pl.Spec.OCIArtifact == nil || pl.Spec.OCIArtifact.Registry == nil || pl.Spec.OCIArtifact.Registry.Auth == nil { return nil } return pl.Spec.OCIArtifact.Registry.Auth.SecretRef }, )
PluginBySecretRef indexes Plugin resources by their .spec.ociArtifact.registry.auth.secretRef.name.
var PluginIndexes = []Entry{ { Object: &artifactv1alpha1.Plugin{}, Field: SecretOnPlugin, ExtractValueFn: PluginBySecretRef, }, }
PluginIndexes holds all field indexes for Plugin resources.
var RulesfileByConfigMapRef = IndexByConfigMapRef( func(rf *artifactv1alpha1.Rulesfile) *commonv1alpha1.ConfigMapRef { return rf.Spec.ConfigMapRef }, )
RulesfileByConfigMapRef indexes Rulesfile resources by their .spec.configMapRef.name.
var RulesfileBySecretRef = IndexBySecretRef( func(rf *artifactv1alpha1.Rulesfile) *commonv1alpha1.SecretRef { if rf.Spec.OCIArtifact == nil || rf.Spec.OCIArtifact.Registry == nil || rf.Spec.OCIArtifact.Registry.Auth == nil { return nil } return rf.Spec.OCIArtifact.Registry.Auth.SecretRef }, )
RulesfileBySecretRef indexes Rulesfile resources by their .spec.ociArtifact.registry.auth.secretRef.name.
var RulesfileIndexes = []Entry{ { Object: &artifactv1alpha1.Rulesfile{}, Field: ConfigMapOnRulesfile, ExtractValueFn: RulesfileByConfigMapRef, }, { Object: &artifactv1alpha1.Rulesfile{}, Field: SecretOnRulesfile, ExtractValueFn: RulesfileBySecretRef, }, }
RulesfileIndexes holds all field indexes for Rulesfile resources.
Functions ¶
func IndexByConfigMapRef ¶
func IndexByConfigMapRef[T client.Object](getRef func(T) *commonv1alpha1.ConfigMapRef) client.IndexerFunc
IndexByConfigMapRef returns a client.IndexerFunc that indexes objects by their ConfigMapRef name. The getRef function extracts the ConfigMapRef from the typed object; return nil when not set.
func IndexBySecretRef ¶
func IndexBySecretRef[T client.Object](getRef func(T) *commonv1alpha1.SecretRef) client.IndexerFunc
IndexBySecretRef returns a client.IndexerFunc that indexes objects by their nested SecretRef name. The getRef function extracts the SecretRef from the typed object; return nil when not set.
Types ¶
type Entry ¶
type Entry struct {
// Object is the object type to index.
Object client.Object
// Field is the name of the index to create.
Field string
// ExtractValueFn is a function that extracts the value to index on from the object.
ExtractValueFn client.IndexerFunc
}
Entry contains the information needed to set up an index for a field on an object.