v1

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 7 Imported by: 21 modules, 10 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package v1 contains API Schema definitions for the notification v1 API group. +kubebuilder:object:generate=true +groupName=notification.toolkit.fluxcd.io

Index

Constants

View Source
const (
	// ActionReconciling indicates a reconciliation is in progress.
	ActionReconciling string = "Reconciling"

	// ActionReconciled indicates a successful reconciliation.
	ActionReconciled string = "Reconciled"

	// ActionFetching indicates fetching of a resource or artifact.
	ActionFetching string = "Fetching"

	// ActionValidating indicates validation is in progress.
	ActionValidating string = "Validating"

	// ActionFailed indicates a failed operation.
	ActionFailed string = "Failed"
)

These constants define the event actions emitted by notification-controller. The action describes what operation was taken or failed regarding the object, and is surfaced on the Flux event/v1 payload sent to notification endpoints.

View Source
const (
	// InitializedReason represents the fact that a given resource has been initialized.
	InitializedReason string = "Initialized"

	// ValidationFailedReason represents the fact that some part of the spec of a given resource
	// couldn't be validated.
	ValidationFailedReason string = "ValidationFailed"

	// TokenNotFoundReason represents the fact that receiver token can't be found.
	TokenNotFoundReason string = "TokenNotFound"

	// MigrationReason represents the fact that a given resource is being
	// migrated to a static resource.
	MigrationReason string = "Migration"

	// InvalidConfigReason represents the fact that part of a given resource's
	// configuration couldn't be used, e.g. an invalid filter regex.
	InvalidConfigReason string = "InvalidConfig"

	// NotificationDispatchFailedReason represents the fact that dispatching a
	// notification to a provider failed.
	NotificationDispatchFailedReason string = "NotificationDispatchFailed"

	// SourceFetchFailedReason represents the fact that the involved object of
	// an event couldn't be fetched to evaluate an alert's source match labels.
	SourceFetchFailedReason string = "SourceFetchFailed"

	// MetadataAppendFailedReason represents the fact that event metadata
	// couldn't be combined due to conflicting keys across the metadata sources.
	MetadataAppendFailedReason string = "MetadataAppendFailed"
)
View Source
const (
	ProviderKind                      string = "Provider"
	GenericProvider                   string = "generic"
	GenericHMACProvider               string = "generic-hmac"
	SlackProvider                     string = "slack"
	GrafanaProvider                   string = "grafana"
	DiscordProvider                   string = "discord"
	MSTeamsProvider                   string = "msteams"
	RocketProvider                    string = "rocket"
	GitHubDispatchProvider            string = "githubdispatch"
	GitHubProvider                    string = "github"
	GitHubPullRequestCommentProvider  string = "githubpullrequestcomment"
	GitLabProvider                    string = "gitlab"
	GitLabMergeRequestCommentProvider string = "gitlabmergerequestcomment"
	GiteaProvider                     string = "gitea"
	GiteaPullRequestCommentProvider   string = "giteapullrequestcomment"
	BitbucketServerProvider           string = "bitbucketserver"
	BitbucketProvider                 string = "bitbucket"
	AzureDevOpsProvider               string = "azuredevops"
	GoogleChatProvider                string = "googlechat"
	GooglePubSubProvider              string = "googlepubsub"
	WebexProvider                     string = "webex"
	SentryProvider                    string = "sentry"
	AzureEventHubProvider             string = "azureeventhub"
	TelegramProvider                  string = "telegram"
	LarkProvider                      string = "lark"
	Matrix                            string = "matrix"
	OpsgenieProvider                  string = "opsgenie"
	AlertManagerProvider              string = "alertmanager"
	PagerDutyProvider                 string = "pagerduty"
	DataDogProvider                   string = "datadog"
	NATSProvider                      string = "nats"
	ZulipProvider                     string = "zulip"
	OTELProvider                      string = "otel"
	ZoomProvider                      string = "zoom"
	IncidentioProvider                string = "incident.io"
	MastodonProvider                  string = "mastodon"
)
View Source
const (
	ReceiverKind        string = "Receiver"
	ReceiverWebhookPath string = "/hook/"
	GenericReceiver     string = "generic"
	GenericHMACReceiver string = "generic-hmac"
	GenericOIDCReceiver string = "generic-oidc"
	GitHubReceiver      string = "github"
	GitLabReceiver      string = "gitlab"
	BitbucketReceiver   string = "bitbucket"
	HarborReceiver      string = "harbor"
	DockerHubReceiver   string = "dockerhub"
	QuayReceiver        string = "quay"
	GCRReceiver         string = "gcr"
	NexusReceiver       string = "nexus"
	ACRReceiver         string = "acr"
	CDEventsReceiver    string = "cdevents"
)
View Source
const (
	AlertKind string = "Alert"
)
View Source
const DefaultOIDCAudience string = "notification-controller"

DefaultOIDCAudience is the default expected audience ('aud' claim) for tokens issued to a 'generic-oidc' Receiver when no audience is configured.

View Source
const NotificationFinalizer = "finalizers.fluxcd.io"

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "notification.toolkit.fluxcd.io", Version: "v1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type Alert added in v1.10.0

type Alert struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec AlertSpec `json:"spec,omitempty"`
}

Alert is the Schema for the alerts API

func (*Alert) DeepCopy added in v1.10.0

func (in *Alert) DeepCopy() *Alert

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Alert.

func (*Alert) DeepCopyInto added in v1.10.0

func (in *Alert) DeepCopyInto(out *Alert)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Alert) DeepCopyObject added in v1.10.0

func (in *Alert) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type AlertList added in v1.10.0

type AlertList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Alert `json:"items"`
}

AlertList contains a list of Alert

func (*AlertList) DeepCopy added in v1.10.0

func (in *AlertList) DeepCopy() *AlertList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertList.

func (*AlertList) DeepCopyInto added in v1.10.0

func (in *AlertList) DeepCopyInto(out *AlertList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*AlertList) DeepCopyObject added in v1.10.0

func (in *AlertList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type AlertSpec added in v1.10.0

type AlertSpec struct {
	// ProviderRef specifies which Provider this Alert should use.
	// +required
	ProviderRef meta.LocalObjectReference `json:"providerRef"`

	// EventSeverity specifies how to filter events based on severity.
	// If set to 'info' no events will be filtered.
	// +kubebuilder:validation:Enum=info;error
	// +kubebuilder:default:=info
	// +optional
	EventSeverity string `json:"eventSeverity,omitempty"`

	// EventSources specifies how to filter events based
	// on the involved object kind, name and namespace.
	// +required
	EventSources []CrossNamespaceObjectReference `json:"eventSources"`

	// InclusionList specifies a list of Golang regular expressions
	// to be used for including messages.
	// +optional
	InclusionList []string `json:"inclusionList,omitempty"`

	// EventMetadata adds metadata to events. Sources, from lowest to highest precedence:
	// `event.toolkit.fluxcd.io/` annotations on the involved object, Alert `.spec.eventMetadata`,
	// and controller-defined `<controller group>.toolkit.fluxcd.io/` event metadata.
	// Higher precedence wins; conflicts produce an info log and a Warning Event.
	// See the Alert API docs (Event metadata section).
	// +optional
	EventMetadata map[string]string `json:"eventMetadata,omitempty"`

	// ExclusionList specifies a list of Golang regular expressions
	// to be used for excluding messages.
	// +optional
	ExclusionList []string `json:"exclusionList,omitempty"`

	// Suspend tells the controller to suspend subsequent
	// events handling for this Alert.
	// +optional
	Suspend bool `json:"suspend,omitempty"`
}

AlertSpec defines an alerting rule for events involving a list of objects.

func (*AlertSpec) DeepCopy added in v1.10.0

func (in *AlertSpec) DeepCopy() *AlertSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertSpec.

func (*AlertSpec) DeepCopyInto added in v1.10.0

func (in *AlertSpec) DeepCopyInto(out *AlertSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CrossNamespaceObjectReference

type CrossNamespaceObjectReference struct {
	// API version of the referent
	// +optional
	APIVersion string `json:"apiVersion,omitempty"`

	// Kind of the referent
	// +kubebuilder:validation:Enum=Bucket;GitRepository;Kustomization;HelmRelease;HelmChart;HelmRepository;ImageRepository;ImagePolicy;ImageUpdateAutomation;OCIRepository;ArtifactGenerator;ExternalArtifact
	// +required
	Kind string `json:"kind"`

	// Name of the referent
	// If multiple resources are targeted `*` may be set.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	// +required
	Name string `json:"name"`

	// Namespace of the referent
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	// +kubebuilder:validation:Optional
	// +optional
	Namespace string `json:"namespace,omitempty"`

	// MatchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
	// map is equivalent to an element of matchExpressions, whose key field is "key", the
	// operator is "In", and the values array contains only "value". The requirements are ANDed.
	// MatchLabels requires the name to be set to `*`.
	// +optional
	MatchLabels map[string]string `json:"matchLabels,omitempty"`
}

CrossNamespaceObjectReference contains enough information to let you locate the typed referenced object at cluster level

func (*CrossNamespaceObjectReference) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrossNamespaceObjectReference.

func (*CrossNamespaceObjectReference) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OIDCProvider added in v1.9.0

type OIDCProvider struct {
	// IssuerURL is the OIDC issuer URL used for provider discovery. It must
	// match the 'iss' claim of tokens issued by this provider.
	// +kubebuilder:validation:Pattern="^https?://"
	// +required
	IssuerURL string `json:"issuerURL"`

	// Audience is the expected audience ('aud' claim) for tokens issued by
	// this provider. Defaults to 'notification-controller'.
	// +optional
	Audience string `json:"audience,omitempty"`

	// Variables is an optional list of named CEL expressions, evaluated in order
	// and exposed as 'vars.<name>'. Each expression can read the token claims
	// via 'claims' and any variable defined before it. Use it to share
	// sub-expressions across validations.
	// +optional
	Variables []OIDCVariable `json:"variables,omitempty"`

	// Validations is the list of CEL boolean expressions evaluated against the
	// token claims and the variables. The request is accepted only if all of
	// them evaluate to true; the message of each failing expression is returned
	// to the caller.
	//
	// At least one validation is required. A valid signature alone does not
	// authorize a request: public issuers issue tokens to any caller on the
	// platform, so the validations must constrain the caller's identity claims
	// (e.g. 'repository_owner' for GitHub Actions).
	// +kubebuilder:validation:MinItems=1
	// +required
	Validations []OIDCValidation `json:"validations"`
}

OIDCProvider configures an OIDC issuer used to authenticate requests for a 'generic-oidc' Receiver.

func (*OIDCProvider) DeepCopy added in v1.9.0

func (in *OIDCProvider) DeepCopy() *OIDCProvider

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OIDCProvider.

func (*OIDCProvider) DeepCopyInto added in v1.9.0

func (in *OIDCProvider) DeepCopyInto(out *OIDCProvider)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*OIDCProvider) GetAudience added in v1.9.0

func (in *OIDCProvider) GetAudience() string

GetAudience returns the expected audience ('aud' claim) for tokens issued by this provider, defaulting to 'notification-controller'.

type OIDCValidation added in v1.9.0

type OIDCValidation struct {
	// Expression is the CEL boolean expression to evaluate.
	// +required
	Expression string `json:"expression"`

	// Message is returned to the caller when the expression evaluates to false.
	// +required
	Message string `json:"message"`
}

OIDCValidation is a CEL boolean expression evaluated against the OIDC token claims and variables of a 'generic-oidc' Receiver.

func (*OIDCValidation) DeepCopy added in v1.9.0

func (in *OIDCValidation) DeepCopy() *OIDCValidation

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OIDCValidation.

func (*OIDCValidation) DeepCopyInto added in v1.9.0

func (in *OIDCValidation) DeepCopyInto(out *OIDCValidation)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OIDCVariable added in v1.9.0

type OIDCVariable struct {
	// Name is the variable name; it must be a valid CEL identifier.
	// +required
	Name string `json:"name"`

	// Expression is the CEL expression that defines the variable value.
	// +required
	Expression string `json:"expression"`
}

OIDCVariable is a named CEL expression evaluated against the OIDC token claims of a 'generic-oidc' Receiver.

func (*OIDCVariable) DeepCopy added in v1.9.0

func (in *OIDCVariable) DeepCopy() *OIDCVariable

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OIDCVariable.

func (*OIDCVariable) DeepCopyInto added in v1.9.0

func (in *OIDCVariable) DeepCopyInto(out *OIDCVariable)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Provider added in v1.10.0

type Provider struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec ProviderSpec `json:"spec,omitempty"`
}

Provider is the Schema for the providers API

func (*Provider) DeepCopy added in v1.10.0

func (in *Provider) DeepCopy() *Provider

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Provider.

func (*Provider) DeepCopyInto added in v1.10.0

func (in *Provider) DeepCopyInto(out *Provider)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Provider) DeepCopyObject added in v1.10.0

func (in *Provider) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Provider) GetTimeout added in v1.10.0

func (in *Provider) GetTimeout() time.Duration

GetTimeout returns the timeout value with a default of 15s for this Provider.

type ProviderList added in v1.10.0

type ProviderList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Provider `json:"items"`
}

ProviderList contains a list of Provider

func (*ProviderList) DeepCopy added in v1.10.0

func (in *ProviderList) DeepCopy() *ProviderList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderList.

func (*ProviderList) DeepCopyInto added in v1.10.0

func (in *ProviderList) DeepCopyInto(out *ProviderList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ProviderList) DeepCopyObject added in v1.10.0

func (in *ProviderList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ProviderSpec added in v1.10.0

type ProviderSpec struct {
	// Type specifies which Provider implementation to use.
	// +kubebuilder:validation:Enum=slack;discord;msteams;rocket;generic;generic-hmac;github;gitlab;gitea;giteapullrequestcomment;bitbucketserver;bitbucket;azuredevops;googlechat;googlepubsub;webex;sentry;azureeventhub;telegram;lark;matrix;opsgenie;alertmanager;grafana;githubdispatch;githubpullrequestcomment;gitlabmergerequestcomment;pagerduty;datadog;nats;zulip;otel;zoom;incident.io;mastodon
	// +required
	Type string `json:"type"`

	// Channel specifies the destination channel where events should be posted.
	// +kubebuilder:validation:MaxLength:=2048
	// +optional
	Channel string `json:"channel,omitempty"`

	// Username specifies the name under which events are posted.
	// +kubebuilder:validation:MaxLength:=2048
	// +optional
	Username string `json:"username,omitempty"`

	// Address specifies the endpoint, in a generic sense, to where alerts are sent.
	// What kind of endpoint depends on the specific Provider type being used.
	// For the generic Provider, for example, this is an HTTP/S address.
	// For other Provider types this could be a project ID or a namespace.
	// +kubebuilder:validation:MaxLength:=2048
	// +kubebuilder:validation:Optional
	// +optional
	Address string `json:"address,omitempty"`

	// Timeout for sending alerts to the Provider.
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ms|s|m))+$"
	// +optional
	Timeout *metav1.Duration `json:"timeout,omitempty"`

	// ProxySecretRef specifies the Secret containing the proxy configuration
	// for this Provider. The Secret should contain an 'address' key with the
	// HTTP/S address of the proxy server. Optional 'username' and 'password'
	// keys can be provided for proxy authentication.
	// +optional
	ProxySecretRef *meta.LocalObjectReference `json:"proxySecretRef,omitempty"`

	// SecretRef specifies the Secret containing the authentication
	// credentials for this Provider.
	// +optional
	SecretRef *meta.LocalObjectReference `json:"secretRef,omitempty"`

	// ServiceAccountName is the name of the Kubernetes ServiceAccount used to
	// authenticate with cloud provider services through object identity.
	// This enables multi-tenant authentication without storing static credentials.
	//
	// Supported provider types: azureeventhub, azuredevops, googlepubsub
	//
	// When specified, the controller will:
	// 1. Create an OIDC token for the specified ServiceAccount
	// 2. Exchange it for cloud provider credentials via STS
	// 3. Use the obtained credentials for API authentication
	//
	// When unspecified, the controller's workload identity is used (single-tenant).
	//
	// An error is thrown if static credentials are also defined in SecretRef.
	//
	// +optional
	ServiceAccountName string `json:"serviceAccountName,omitempty"`

	// CertSecretRef specifies the Secret containing TLS certificates
	// for secure communication.
	//
	// Supported configurations:
	// - CA-only: Server authentication (provide ca.crt only)
	// - mTLS: Mutual authentication (provide ca.crt + tls.crt + tls.key)
	// - Client-only: Client authentication with system CA (provide tls.crt + tls.key only)
	//
	// Legacy keys "caFile", "certFile", "keyFile" are supported but deprecated. Use "ca.crt", "tls.crt", "tls.key" instead.
	//
	// +optional
	CertSecretRef *meta.LocalObjectReference `json:"certSecretRef,omitempty"`

	// Suspend tells the controller to suspend subsequent
	// events handling for this Provider.
	// +optional
	Suspend bool `json:"suspend,omitempty"`

	// CommitStatusExpr is a CEL expression that evaluates to a string value
	// that can be used to generate a custom commit status message for use
	// with eligible Provider types (github, gitlab, gitea, bitbucketserver,
	// bitbucket, azuredevops). Supported variables are: event, provider,
	// and alert.
	// +optional
	CommitStatusExpr string `json:"commitStatusExpr,omitempty"`
}

ProviderSpec defines the desired state of the Provider. +kubebuilder:validation:XValidation:rule="self.type == 'github' || self.type == 'gitlab' || self.type == 'gitea' || self.type == 'bitbucketserver' || self.type == 'bitbucket' || self.type == 'azuredevops' || !has(self.commitStatusExpr)", message="spec.commitStatusExpr is only supported for the 'github', 'gitlab', 'gitea', 'bitbucketserver', 'bitbucket', 'azuredevops' provider types"

func (*ProviderSpec) DeepCopy added in v1.10.0

func (in *ProviderSpec) DeepCopy() *ProviderSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderSpec.

func (*ProviderSpec) DeepCopyInto added in v1.10.0

func (in *ProviderSpec) DeepCopyInto(out *ProviderSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Receiver

type Receiver struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec ReceiverSpec `json:"spec,omitempty"`
	// +kubebuilder:default:={"observedGeneration":-1}
	Status ReceiverStatus `json:"status,omitempty"`
}

Receiver is the Schema for the receivers API.

func (*Receiver) DeepCopy

func (in *Receiver) DeepCopy() *Receiver

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Receiver.

func (*Receiver) DeepCopyInto

func (in *Receiver) DeepCopyInto(out *Receiver)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Receiver) DeepCopyObject

func (in *Receiver) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Receiver) GetConditions

func (in *Receiver) GetConditions() []metav1.Condition

GetConditions returns the status conditions of the object.

func (*Receiver) GetInterval

func (in *Receiver) GetInterval() time.Duration

GetInterval returns the interval value with a default of 10m for this Receiver.

func (*Receiver) GetWebhookPath

func (in *Receiver) GetWebhookPath(token string) string

GetWebhookPath returns the incoming webhook path for the given token.

func (*Receiver) SetConditions

func (in *Receiver) SetConditions(conditions []metav1.Condition)

SetConditions sets the status conditions on the object.

type ReceiverList

type ReceiverList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Receiver `json:"items"`
}

ReceiverList contains a list of Receivers.

func (*ReceiverList) DeepCopy

func (in *ReceiverList) DeepCopy() *ReceiverList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReceiverList.

func (*ReceiverList) DeepCopyInto

func (in *ReceiverList) DeepCopyInto(out *ReceiverList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ReceiverList) DeepCopyObject

func (in *ReceiverList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ReceiverResource added in v1.9.0

type ReceiverResource struct {
	CrossNamespaceObjectReference `json:",inline"`

	// Filter is a CEL expression expected to return a boolean that is evaluated
	// for each resource matched by this reference when a webhook is received,
	// in addition to the top-level resourceFilter. A reconciliation is requested
	// only when both expressions (when set) return true.
	// The expression can read the resource metadata via 'res' and the webhook
	// request body via 'req'. For generic-oidc receivers, the verified OIDC
	// token claims are also available via 'claims'.
	// When the expression is specified the controller will parse it and mark
	// the object as terminally failed if the expression is invalid or does not
	// return a boolean.
	// +optional
	Filter string `json:"filter,omitempty"`
}

ReceiverResource references a resource to be notified about changes, with an optional per-resource CEL filter.

func (*ReceiverResource) DeepCopy added in v1.9.0

func (in *ReceiverResource) DeepCopy() *ReceiverResource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReceiverResource.

func (*ReceiverResource) DeepCopyInto added in v1.9.0

func (in *ReceiverResource) DeepCopyInto(out *ReceiverResource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ReceiverSpec

type ReceiverSpec struct {
	// Type of webhook sender, used to determine
	// the validation procedure and payload deserialization.
	// +kubebuilder:validation:Enum=generic;generic-hmac;generic-oidc;github;gitlab;bitbucket;harbor;dockerhub;quay;gcr;nexus;acr;cdevents
	// +required
	Type string `json:"type"`

	// Interval at which to reconcile the Receiver with its Secret references.
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$"
	// +kubebuilder:default:="10m"
	// +optional
	Interval *metav1.Duration `json:"interval,omitempty"`

	// Events specifies the list of event types to handle,
	// e.g. 'push' for GitHub or 'Push Hook' for GitLab.
	// +optional
	Events []string `json:"events,omitempty"`

	// A list of resources to be notified about changes.
	// +required
	Resources []ReceiverResource `json:"resources"`

	// ResourceFilter is a CEL expression expected to return a boolean that is
	// evaluated for each resource referenced in the Resources field when a
	// webhook is received. If the expression returns false then the controller
	// will not request a reconciliation for the resource.
	// The expression can read the resource metadata via 'res' and the webhook
	// request body via 'req'. For generic-oidc receivers, the verified OIDC
	// token claims are also available via 'claims'.
	// When the expression is specified the controller will parse it and mark
	// the object as terminally failed if the expression is invalid or does not
	// return a boolean.
	// +optional
	ResourceFilter string `json:"resourceFilter,omitempty"`

	// SecretRef specifies the Secret containing the token used
	// to validate the payload authenticity. The Secret must contain a 'token'
	// key. For GCR receivers, the Secret must also contain an 'email' key
	// with the IAM service account email configured on the Pub/Sub push
	// subscription, and an 'audience' key with the expected OIDC token audience.
	//
	// Required for all receiver types except 'generic-oidc', which authenticates
	// requests using the OIDC token instead and must not set this field.
	// +optional
	SecretRef *meta.LocalObjectReference `json:"secretRef,omitempty"`

	// OIDCProviders specifies the OIDC providers used to authenticate incoming
	// requests when Type is 'generic-oidc'. The provider whose IssuerURL matches
	// the token's 'iss' claim is used to verify the token signature, expiration
	// and audience, and to evaluate the configured CEL validations against the
	// token claims.
	// +listType=map
	// +listMapKey=issuerURL
	// +optional
	OIDCProviders []OIDCProvider `json:"oidcProviders,omitempty"`

	// Suspend tells the controller to suspend subsequent
	// events handling for this receiver.
	// +optional
	Suspend bool `json:"suspend,omitempty"`
}

ReceiverSpec defines the desired state of the Receiver. +kubebuilder:validation:XValidation:rule="self.type != 'generic-oidc' || (has(self.oidcProviders) && size(self.oidcProviders) > 0)",message="generic-oidc receivers must define at least one oidcProvider" +kubebuilder:validation:XValidation:rule="self.type == 'generic-oidc' || !has(self.oidcProviders) || size(self.oidcProviders) == 0",message="oidcProviders can only be set when type is generic-oidc" +kubebuilder:validation:XValidation:rule="self.type != 'generic-oidc' || !has(self.secretRef)",message="secretRef cannot be set when type is generic-oidc" +kubebuilder:validation:XValidation:rule="self.type == 'generic-oidc' || has(self.secretRef)",message="secretRef is required when type is not generic-oidc"

func (*ReceiverSpec) DeepCopy

func (in *ReceiverSpec) DeepCopy() *ReceiverSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReceiverSpec.

func (*ReceiverSpec) DeepCopyInto

func (in *ReceiverSpec) DeepCopyInto(out *ReceiverSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ReceiverStatus

type ReceiverStatus struct {
	meta.ReconcileRequestStatus `json:",inline"`

	// Conditions holds the conditions for the Receiver.
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// WebhookPath is the generated incoming webhook address in the format
	// of '/hook/sha256sum(token+name+namespace)'.
	// +optional
	WebhookPath string `json:"webhookPath,omitempty"`

	// ObservedGeneration is the last observed generation of the Receiver object.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}

ReceiverStatus defines the observed state of the Receiver.

func (*ReceiverStatus) DeepCopy

func (in *ReceiverStatus) DeepCopy() *ReceiverStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReceiverStatus.

func (*ReceiverStatus) DeepCopyInto

func (in *ReceiverStatus) DeepCopyInto(out *ReceiverStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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