Documentation
¶
Overview ¶
Package integrationcap selects Integrations by the capability they provide. More than one controller reads Integration configuration: the integration-controller's receiver routes deliveries by capability, and the context-controller reads the enhancers' settings. Keeping selection here stops the rule (exactly one enabled Integration per capability per namespace, the v1alpha1 singleton rule) from forking between them.
Index ¶
- Variables
- func AWSResourceTagsEnabled(i *v1alpha1.Integration) bool
- func AzureResourceTagsEnabled(i *v1alpha1.Integration) bool
- func BackfillSupported(i *v1alpha1.Integration) bool
- func CloudAssetInventoryEnabled(i *v1alpha1.Integration) bool
- func GenericEnhanceEnabled(i *v1alpha1.Integration) bool
- func Select(ctx context.Context, r client.Reader, namespace string, has Capability) (*v1alpha1.Integration, error)
- type Capability
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoIntegration: no enabled Integration provides the capability. ErrNoIntegration = errors.New("no integration provides the capability") // ErrAmbiguousIntegration: several Integrations provide the capability, // but v1alpha1 requires exactly one per namespace. ErrAmbiguousIntegration = errors.New("multiple integrations provide the capability") )
Sentinel errors for integration selection.
Functions ¶
func AWSResourceTagsEnabled ¶
func AWSResourceTagsEnabled(i *v1alpha1.Integration) bool
AWSResourceTagsEnabled reports whether the Integration enables the AWS resource-tags enhancer. It lives here for the same reason as CloudAssetInventoryEnabled: its consumer is the context-controller.
func AzureResourceTagsEnabled ¶
func AzureResourceTagsEnabled(i *v1alpha1.Integration) bool
AzureResourceTagsEnabled reports whether the Integration enables the Azure resource-tags enhancer. It lives here for the same reason as CloudAssetInventoryEnabled: its consumer is the context-controller.
func BackfillSupported ¶ added in v0.15.0
func BackfillSupported(i *v1alpha1.Integration) bool
BackfillSupported reports whether a backfill request could do anything on the Integration: the github provider with code-scanning or secret-scanning ingestion enabled, the same gate the integration-controller's lister applies. It ignores spec.suspend, so callers that act on the answer check that separately. The status server's configuration view and repositories page, and the integration-controller's repository-access check, all decide with it.
func CloudAssetInventoryEnabled ¶
func CloudAssetInventoryEnabled(i *v1alpha1.Integration) bool
CloudAssetInventoryEnabled reports whether the Integration enables the Cloud Asset Inventory enhancer. It lives here rather than beside the receiver's ingestion predicates because its consumer is the context-controller, which must not import the integration-controller.
func GenericEnhanceEnabled ¶ added in v0.9.1
func GenericEnhanceEnabled(i *v1alpha1.Integration) bool
GenericEnhanceEnabled reports whether the Integration enables the external generic enhancer. It lives here for the same reason as CloudAssetInventoryEnabled: its consumer is the context-controller. Unlike every other capability, generic is exempt from the Select singleton rule: any number of generic integrations enhance side by side, so consumers List with this predicate rather than Select with it.
Types ¶
type Capability ¶
type Capability func(*v1alpha1.Integration) bool
Capability selects Integrations by what they provide.