v1beta2

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 9 Imported by: 5

Documentation

Overview

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

Index

Constants

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"
)
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"
	GitLabProvider          string = "gitlab"
	GiteaProvider           string = "gitea"
	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"
)
View Source
const (
	ReceiverKind        string = "Receiver"
	ReceiverWebhookPath string = "/hook/"
	GenericReceiver     string = "generic"
	GenericHMACReceiver string = "generic-hmac"
	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"
)
View Source
const (
	AlertKind string = "Alert"
)
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: "v1beta2"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

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

Functions

This section is empty.

Types

type Alert

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

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

Alert is the Schema for the alerts API

func (*Alert) DeepCopy

func (in *Alert) DeepCopy() *Alert

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

func (*Alert) DeepCopyInto

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

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

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

func (*Alert) GetConditions

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

GetConditions returns the status conditions of the object.

func (*Alert) SetConditions

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

SetConditions sets the status conditions on the object.

type AlertList

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

AlertList contains a list of Alerts.

func (*AlertList) DeepCopy

func (in *AlertList) DeepCopy() *AlertList

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

func (*AlertList) DeepCopyInto

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

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

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

type AlertSpec

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 []v1.CrossNamespaceObjectReference `json:"eventSources"`

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

	// EventMetadata is an optional field for adding metadata to events dispatched by the
	// controller. This can be used for enhancing the context of the event. If a field
	// would override one already present on the original event as generated by the emitter,
	// then the override doesn't happen, i.e. the original value is preserved, and an info
	// log is printed.
	// +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"`

	// Summary holds a short description of the impact and affected cluster.
	// +kubebuilder:validation:MaxLength:=255
	// +optional
	Summary string `json:"summary,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

func (in *AlertSpec) DeepCopy() *AlertSpec

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

func (*AlertSpec) DeepCopyInto

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

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

type AlertStatus

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

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

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

AlertStatus defines the observed state of the Alert.

func (*AlertStatus) DeepCopy

func (in *AlertStatus) DeepCopy() *AlertStatus

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

func (*AlertStatus) DeepCopyInto

func (in *AlertStatus) DeepCopyInto(out *AlertStatus)

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
	// +required
	Kind string `json:"kind,omitempty"`

	// Name of the referent.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=53
	// +required
	Name string `json:"name"`

	// Namespace of the referent.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=53
	// +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.
	// +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 Provider

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

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

Provider is the Schema for the providers API.

func (*Provider) DeepCopy

func (in *Provider) DeepCopy() *Provider

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

func (*Provider) DeepCopyInto

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

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

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

func (*Provider) GetConditions

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

GetConditions returns the status conditions of the object.

func (*Provider) GetInterval added in v0.30.1

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

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

func (*Provider) GetRequeueAfter

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

GetRequeueAfter returns the duration after which the Provider must be reconciled again.

func (*Provider) GetTimeout

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

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

func (*Provider) SetConditions

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

SetConditions sets the status conditions on the object.

type ProviderList

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

ProviderList contains a list of Providers.

func (*ProviderList) DeepCopy

func (in *ProviderList) DeepCopy() *ProviderList

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

func (*ProviderList) DeepCopyInto

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

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

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

type ProviderSpec

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

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

	// 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"`

	// Proxy the HTTP/S address of the proxy server.
	// +kubebuilder:validation:Pattern="^(http|https)://.*$"
	// +kubebuilder:validation:MaxLength:=2048
	// +kubebuilder:validation:Optional
	// +optional
	Proxy string `json:"proxy,omitempty"`

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

	// CertSecretRef specifies the Secret containing
	// a PEM-encoded CA certificate (in the `ca.crt` key).
	// +optional
	//
	// Note: Support for the `caFile` key has
	// been deprecated.
	CertSecretRef *meta.LocalObjectReference `json:"certSecretRef,omitempty"`

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

ProviderSpec defines the desired state of the Provider.

func (*ProviderSpec) DeepCopy

func (in *ProviderSpec) DeepCopy() *ProviderSpec

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

func (*ProviderSpec) DeepCopyInto

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

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

type ProviderStatus

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

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

	// ObservedGeneration is the last reconciled generation.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}

ProviderStatus defines the observed state of the Provider.

func (*ProviderStatus) DeepCopy

func (in *ProviderStatus) DeepCopy() *ProviderStatus

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

func (*ProviderStatus) DeepCopyInto

func (in *ProviderStatus) DeepCopyInto(out *ProviderStatus)

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 added in v0.30.1

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 ReceiverSpec

type ReceiverSpec struct {
	// Type of webhook sender, used to determine
	// the validation procedure and payload deserialization.
	// +kubebuilder:validation:Enum=generic;generic-hmac;github;gitlab;bitbucket;harbor;dockerhub;quay;gcr;nexus;acr
	// +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))+$"
	// +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"`

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

	// SecretRef specifies the Secret containing the token used
	// to validate the payload authenticity.
	// +required
	SecretRef meta.LocalObjectReference `json:"secretRef,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.

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"`

	// URL is the generated incoming webhook address in the format
	// of '/hook/sha256sum(token+name+namespace)'.
	// Deprecated: Replaced by WebhookPath.
	// +optional
	URL string `json:"url,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