resources

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TriggersMetricsDomain = "tekton.dev/triggers"
)

Variables

View Source
var (
	// DefaultImage is the image used by default.
	DefaultImage = "override-with-el:latest"
	// DefaultPort is the port used by default.
	DefaultPort = 8080
	// DefaultSetSecurityContext is the SetSecurityContext value used by default.
	DefaultSetSecurityContext = true
	// DefaultEventListenerEvent is the EventListenerEvent value used by default.
	DefaultEventListenerEvent = "disable"
	// DefaultReadTimeout is the ReadTimeout used by default.
	DefaultReadTimeout = int64(5)
	// DefaultWriteTimeout is the WriteTimeout used by default.
	DefaultWriteTimeout = int64(40)
	// DefaultIdleTimeout is the IdleTimeout used by default.
	DefaultIdleTimeout = int64(30)
	// DefaultTimeOutHandler is the TimeOutHandler timeout used by default.
	DefaultTimeOutHandler = int64(5)
	// DefaultPeriodSeconds is the PeriodSeconds used by default.
	DefaultPeriodSeconds = 10
	// DefaultFailureThreshold is the FailureThreshold used by default.
	DefaultFailureThreshold = 3
	// DefaultHTTPClientReadTimeOut is the HTTPClient ReadTimeOut used by default.
	DefaultHTTPClientReadTimeOut = int64(30)
	// DefaultHTTPClientKeepAlive is the HTTPClient KeepAlive used by default
	DefaultHTTPClientKeepAlive = int64(30)
	// DefaultHTTPClientTLSHandshakeTimeout is the HTTPClient TLS Handshake timeout used by default
	DefaultHTTPClientTLSHandshakeTimeout = int64(10)
	// DefaultHTTPClientResponseHeaderTimeout is the HTTPClient Response Header Timeout
	DefaultHTTPClientResponseHeaderTimeout = int64(10)
	// DefaultHTTPClientExpectContinueTimeout is the HTTPClient Expect Continue Timeout
	DefaultHTTPClientExpectContinueTimeout = int64(1)
	// DefaultStaticResourceLabels are the StaticResourceLabels used by default.
	DefaultStaticResourceLabels = map[string]string{
		"app.kubernetes.io/managed-by": "EventListener",
		"app.kubernetes.io/part-of":    "Triggers",
	}
	// DefaultSystemNamespace is the default system namespace used.
	DefaultSystemNamespace = "tekton-pipelines"
)

Functions

func FilterLabels added in v0.17.0

func FilterLabels(ctx context.Context, labels map[string]string) map[string]string

FilterLabels filters label based on regex pattern defined in feature-flag `labels-exclusion-pattern`

func GenerateLabels

func GenerateLabels(eventListenerName string, staticResourceLabels map[string]string) map[string]string

GenerateLabels generates the labels to be used on all generated resources.

func ListenerHostname

func ListenerHostname(el *v1beta1.EventListener, c Config) string

ListenerHostname returns the intended hostname for the EventListener service.

func MakeService

func MakeService(ctx context.Context, el *v1beta1.EventListener, c Config) *corev1.Service

func ObjectMeta

func ObjectMeta(el *v1beta1.EventListener, filteredElLabels, staticResourceLabels map[string]string) metav1.ObjectMeta

ObjectMeta generates the object meta that should be used by all resources generated by the EventListener reconciler

func ServicePort

func ServicePort(el *v1beta1.EventListener, c Config) corev1.ServicePort

func UpdateCustomObject added in v0.17.0

func UpdateCustomObject(originalData, updatedCustomObject *unstructured.Unstructured) (bool, *duckv1.WithPod, error)

Types

type Config

type Config struct {
	// Image defines the container that we use to run in the EventListener Pods.
	Image *string
	// Port defines the port for the EventListener to listen on.
	Port *int
	// SetSecurityContext defines if the security context is set.
	SetSecurityContext *bool
	// SetEventListenerEvent defines to enable or disable of emitting events for EventListener.
	SetEventListenerEvent *string
	// ReadTimeOut defines the read timeout for EventListener Server.
	ReadTimeOut *int64
	// WriteTimeOut defines the write timeout for EventListener Server.
	WriteTimeOut *int64
	// IdleTimeOut defines the read timeout for EventListener Server.
	IdleTimeOut *int64
	// TimeOutHandler defines the timeout for Timeout Handler of EventListener Server.
	TimeOutHandler *int64
	// HTTPClientReadTimeOut defines the Read timeout for HTTP Client
	HTTPClientReadTimeOut *int64
	// HTTPClientKeepAlive defines the Keep Alive for HTTP Client
	HTTPClientKeepAlive *int64
	// HTTPClientTLSHandshakeTimeout defines the Handshake timeout for HTTP Client
	HTTPClientTLSHandshakeTimeout *int64
	// HTTPClientResponseHeaderTimeout defines the Response Header timeout for HTTP Client
	HTTPClientResponseHeaderTimeout *int64
	// HTTPClientExpectContinueTimeout defines the Expect timeout for HTTP Client
	HTTPClientExpectContinueTimeout *int64
	// PeriodSeconds defines Period Seconds for the EventListener Liveness and Readiness Probes.
	PeriodSeconds *int
	// FailureThreshold defines the Failure Threshold for the EventListener Liveness and Readiness Probes.
	FailureThreshold *int
	// StaticResourceLabels is a map with all the labels that should be on all resources generated by the EventListener.
	StaticResourceLabels map[string]string
	// SystemNamespace is the namespace where the reconciler is deployed.
	SystemNamespace string
}

func MakeConfig

func MakeConfig(ops ...ConfigOption) *Config

MakeConfig is a helper to build a config that is consumed by an EventListener. It generates a default Config for the EventListener without any flags set and accepts functions for modification.

type ConfigOption

type ConfigOption func(d *Config)

type ContainerOption

type ContainerOption func(*corev1.Container)

Jump to

Keyboard shortcuts

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