functionconfig

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: Apache-2.0 Imports: 23 Imported by: 2 modules, 8 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

Index

Constants

View Source
const (
	ReferencePrefix                  = "$ref:"
	ReferenceToEnvVarPrefix          = "NUCLIO_B64_"
	NuclioFlexVolumeSecretNamePrefix = "nuclio-flexvolume"
	SecretTypeFunctionConfig         = "nuclio.io/functionconfig"
	SecretTypeV3ioFuse               = "v3io/fuse"
	SecretContentKey                 = "content"
	FunctionSecretMountPath          = "/etc/nuclio/secrets"
)
View Source
const (
	BatchModeEnable  BatchMode = "enable"
	BatchModeDisable BatchMode = "disable"

	DefaultBatchSize    = 10
	DefaultBatchTimeout = "1s"
)
View Source
const (

	// ExplicitAckModeEnable allows explicit and implicit ack according to the "x-nuclio-stream-no-ack" header
	ExplicitAckModeEnable ExplicitAckMode = "enable"

	// ExplicitAckModeDisable disables the explicit ack feature and allows only implicit acks (default)
	ExplicitAckModeDisable ExplicitAckMode = "disable"

	// ExplicitAckModeExplicitOnly allows only explicit acks and disables implicit acks
	ExplicitAckModeExplicitOnly ExplicitAckMode = "explicitOnly"

	// DefaultWorkerTerminationTimeout wait time for workers to drop or ack events before rebalance initiates
	DefaultWorkerTerminationTimeout string = "10s"
)
View Source
const (
	FunctionAnnotationSkipBuild   = "skip-build"
	FunctionAnnotationSkipDeploy  = "skip-deploy"
	FunctionAnnotationPrevState   = "nuclio.io/previous-state"
	FunctionAnnotationForceUpdate = "nuclio.io/force-update"
)
View Source
const (
	NvidiaGPUResourceName = "nvidia.com/gpu"
)

Variables

View Source
var FixableValidationErrors = []string{"V3IO Stream trigger does not support autoscaling"}

Functions

func BatchModeEnabled

func BatchModeEnabled(batchConfiguration *BatchConfiguration) bool

func ExplicitAckEnabled

func ExplicitAckEnabled(mode ExplicitAckMode) bool

func ExplicitAckModeInSlice

func ExplicitAckModeInSlice(ackMode ExplicitAckMode, ackModes []ExplicitAckMode) bool

func FunctionStateInSlice

func FunctionStateInSlice(functionState FunctionState, functionStates []FunctionState) bool

func FunctionStateProvisioned

func FunctionStateProvisioned(functionState FunctionState) bool

func FunctionStateProvisioning

func FunctionStateProvisioning(functionState FunctionState) bool

func GetFunctionIngresses

func GetFunctionIngresses(config *Config) map[string]Ingress

func GetTriggersByKind

func GetTriggersByKind(triggers map[string]Trigger, kind string) map[string]Trigger

GetTriggersByKind returns a map of triggers by their kind

func GetTriggersByKinds

func GetTriggersByKinds(triggers map[string]Trigger, kinds []string) map[string]Trigger

GetTriggersByKinds returns a map of triggers by their kinds

func IsPreviousFunctionStateAllowedToBeSet

func IsPreviousFunctionStateAllowedToBeSet(prevState FunctionState) bool

func ParseHandler

func ParseHandler(handler string) (string, string, error)

func ResolveFunctionServiceType

func ResolveFunctionServiceType(functionSpec *Spec, defaultServiceType v1.ServiceType) v1.ServiceType

func RuntimeSupportExplicitAck

func RuntimeSupportExplicitAck(runtime string) bool

func RuntimeSupportsBatching

func RuntimeSupportsBatching(runtime string) bool

func ShouldSkipBuild

func ShouldSkipBuild(annotations map[string]string) bool

func ShouldSkipDeploy

func ShouldSkipDeploy(annotations map[string]string) bool

func TriggerKindSupportsBatching

func TriggerKindSupportsBatching(triggerKind string) bool

Types

type AutoScaleDisplayType

type AutoScaleDisplayType string
const (
	AutoScaleMetricTypeInt        AutoScaleDisplayType = "int"
	AutoScaleMetricTypePercentage AutoScaleDisplayType = "percentage"
)

type AutoScaleMetric

type AutoScaleMetric struct {
	ScaleResource `json:",inline"`
	SourceType    autosv2.MetricSourceType `json:"sourceType,omitempty"`
	DisplayType   AutoScaleDisplayType     `json:"displayType,omitempty"`
}

type BatchConfiguration

type BatchConfiguration struct {
	Mode      BatchMode `json:"mode,omitempty"`
	BatchSize int       `json:"batchSize,omitempty"`
	Timeout   string    `json:"timeout,omitempty"`
}

type BatchMode

type BatchMode string

type Build

type Build struct {
	Path                  string                 `json:"path,omitempty"`
	FunctionSourceCode    string                 `json:"functionSourceCode,omitempty"`
	FunctionConfigPath    string                 `json:"functionConfigPath,omitempty"`
	TempDir               string                 `json:"tempDir,omitempty"`
	Registry              string                 `json:"registry,omitempty"`
	BaseImageRegistry     string                 `json:"baseImageRegistry,omitempty"`
	Image                 string                 `json:"image,omitempty"`
	NoBaseImagesPull      bool                   `json:"noBaseImagesPull,omitempty"`
	NoCache               bool                   `json:"noCache,omitempty"`
	NoCleanup             bool                   `json:"noCleanup,omitempty"`
	BaseImage             string                 `json:"baseImage,omitempty"`
	Commands              []string               `json:"commands,omitempty"`
	Directives            map[string][]Directive `json:"directives,omitempty"`
	ScriptPaths           []string               `json:"scriptPaths,omitempty"`
	AddedObjectPaths      map[string]string      `json:"addedPaths,omitempty"`
	Dependencies          []string               `json:"dependencies,omitempty"`
	OnbuildImage          string                 `json:"onbuildImage,omitempty"`
	Offline               bool                   `json:"offline,omitempty"`
	RuntimeAttributes     map[string]interface{} `json:"runtimeAttributes,omitempty"`
	CodeEntryType         string                 `json:"codeEntryType,omitempty"`
	CodeEntryAttributes   map[string]interface{} `json:"codeEntryAttributes,omitempty"`
	Timestamp             int64                  `json:"timestamp,omitempty"`
	BuildTimeoutSeconds   *int64                 `json:"buildTimeoutSeconds,omitempty"`
	Mode                  BuildMode              `json:"mode,omitempty"`
	Args                  map[string]string      `json:"args,omitempty"`
	Flags                 []string               `json:"flags,omitempty"`
	BuilderServiceAccount string                 `json:"builderServiceAccount,omitempty"`
}

Build holds all configuration parameters related to building a function

type BuildMode

type BuildMode string
const (
	NeverBuild  BuildMode = "neverBuild"
	AlwaysBuild BuildMode = "alwaysBuild"
)

type Checkpoint

type Checkpoint *string

Checkpoint is a partition checkpoint

type Config

type Config struct {
	Meta Meta `json:"metadata,omitempty"`
	Spec Spec `json:"spec,omitempty"`
}

Config holds the configuration of a function - meta and spec

func GetFunctionConfigFromInterface

func GetFunctionConfigFromInterface(functionConfigInterface interface{}) *Config

func NewConfig

func NewConfig() *Config

NewConfig creates a new configuration structure

func (*Config) AddPrevStateAnnotation

func (c *Config) AddPrevStateAnnotation(state string)

func (*Config) AddSkipAnnotations

func (c *Config) AddSkipAnnotations()

func (*Config) CleanFunctionSpec

func (c *Config) CleanFunctionSpec()

func (*Config) EnrichWithNodeSelectors

func (c *Config) EnrichWithNodeSelectors(nodeSelector map[string]string)

func (*Config) EnrichWithTolerations

func (c *Config) EnrichWithTolerations(tolerations []v1.Toleration)

func (*Config) GetProjectName

func (c *Config) GetProjectName() (string, error)

func (*Config) PrepareFunctionForExport

func (c *Config) PrepareFunctionForExport(exportOptions *common.ExportFunctionOptions)

func (*Config) PruneAffinityNodeSelectorRequirement

func (c *Config) PruneAffinityNodeSelectorRequirement(nodeSelectorRequirements []v1.NodeSelectorRequirement, mode string)

PruneAffinityNodeSelectorRequirement prunes given affinity node selector requirement from function spec

func (*Config) PruneNodeSelector

func (c *Config) PruneNodeSelector(nodeSelector map[string]string)

PruneNodeSelector prunes given node selector key from function spec if their key, value are matching

func (*Config) PruneTolerations

func (c *Config) PruneTolerations(tolerations []v1.Toleration)

PruneTolerations prunes given tolerations from function spec

type ConfigWithStatus

type ConfigWithStatus struct {
	Config `json:",inline" yaml:",inline"`
	Status Status `json:"status,omitempty"`
}

ConfigWithStatus holds the config and status of a function

type DataBinding

type DataBinding struct {
	Name       string                 `json:"name,omitempty"`
	Class      string                 `json:"class"`
	Kind       string                 `json:"kind"`
	URL        string                 `json:"url"`
	Path       string                 `json:"path,omitempty"`
	Query      string                 `json:"query,omitempty"`
	Secret     string                 `json:"secret,omitempty"`
	Attributes map[string]interface{} `json:"attributes,omitempty"`
}

DataBinding holds configuration for a databinding

type Directive

type Directive struct {
	Kind  string `json:"kind,omitempty"`
	Value string `json:"value,omitempty"`
}

Directive is injected into the image file (e.g. Dockerfile) generated during build

type ExplicitAckMode

type ExplicitAckMode string

type FunctionState

type FunctionState string

FunctionState is state of function

const (
	FunctionStateWaitingForBuild                  FunctionState = "waitingForBuild"
	FunctionStateBuilding                         FunctionState = "building"
	FunctionStateWaitingForResourceConfiguration  FunctionState = "waitingForResourceConfiguration"
	FunctionStateWaitingForScaleResourcesFromZero FunctionState = "waitingForScaleResourceFromZero"
	FunctionStateWaitingForScaleResourcesToZero   FunctionState = "waitingForScaleResourceToZero"
	FunctionStateConfiguringResources             FunctionState = "configuringResources"
	FunctionStateReady                            FunctionState = "ready"
	FunctionStateError                            FunctionState = "error"
	FunctionStateUnhealthy                        FunctionState = "unhealthy"
	FunctionStateScaledToZero                     FunctionState = "scaledToZero"
	FunctionStateImported                         FunctionState = "imported"
)

Possible function states

type Ingress

type Ingress struct {
	Host             string                `json:"host,omitempty"`
	Paths            []string              `json:"paths,omitempty"`
	PathType         networkingv1.PathType `json:"pathType,omitempty"`
	TLS              IngressTLS            `json:"tls,omitempty"`
	IngressClassName string                `json:"ingressClassName,omitempty"`
}

Ingress holds configuration for an ingress - an entity that can route HTTP requests to the function

type IngressTLS

type IngressTLS struct {
	Hosts      []string `json:"hosts,omitempty"`
	SecretName string   `json:"secretName,omitempty"`
}

IngressTLS holds configuration for an ingress's TLS

type LoggerSink

type LoggerSink struct {
	Level string `json:"level,omitempty"`
	Sink  string `json:"sink,omitempty"`
}

LoggerSink overrides the default platform configuration for function loggers

type Meta

type Meta struct {
	Name        string            `json:"name,omitempty"`
	Namespace   string            `json:"namespace,omitempty"`
	Labels      map[string]string `json:"labels,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty"`

	// Used to determine whether the object is stale
	// more details @ https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions
	ResourceVersion string `json:"resourceVersion,omitempty"`
}

Meta identifies a function

func (*Meta) AddSkipBuildAnnotation

func (m *Meta) AddSkipBuildAnnotation()

func (*Meta) AddSkipDeployAnnotation

func (m *Meta) AddSkipDeployAnnotation()

func (*Meta) GetUniqueID

func (m *Meta) GetUniqueID() string

GetUniqueID return unique id

func (*Meta) RemoveSkipBuildAnnotation

func (m *Meta) RemoveSkipBuildAnnotation()

func (*Meta) RemoveSkipDeployAnnotation

func (m *Meta) RemoveSkipDeployAnnotation()

type Metric

type Metric struct {
	SourceType     string `json:"sourceType,omitempty"`
	ThresholdValue int64  `json:"thresholdValue,omitempty"`
	WindowSize     string `json:"windowSize,omitempty"`
}

type Partition

type Partition struct {
	ID         string     `json:"id"`
	Checkpoint Checkpoint `json:"checkpoint,omitempty"`
}

Partition is a partition information

type Platform

type Platform struct {
	Attributes map[string]interface{} `json:"attributes,omitempty"`
}

Platform holds platform specific attributes

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

func NewReader

func NewReader(parentLogger logger.Logger) (*Reader, error)

func (*Reader) Read

func (r *Reader) Read(reader io.Reader, configType string, config *Config) error

Merges codeEntry config with the function config. CodeEntry config will get overridden by config values. Enriches config with env vars existing only in codeEntry config

func (*Reader) ReadFunctionConfigFile

func (r *Reader) ReadFunctionConfigFile(functionConfigPath string, config *Config) error

type RunOnPreemptibleNodeMode

type RunOnPreemptibleNodeMode string
const (

	// RunOnPreemptibleNodesAllow makes function pods be able to run on preemptible nodes
	RunOnPreemptibleNodesAllow RunOnPreemptibleNodeMode = "allow"

	// RunOnPreemptibleNodesConstrain makes the function pods run on preemtible nodes only
	RunOnPreemptibleNodesConstrain RunOnPreemptibleNodeMode = "constrain"

	// RunOnPreemptibleNodesPrevent prevents the function pods from running on preemptible nodes
	RunOnPreemptibleNodesPrevent RunOnPreemptibleNodeMode = "prevent"

	// RunOnPreemptibleNodesNone do nothing
	RunOnPreemptibleNodesNone RunOnPreemptibleNodeMode = "none"
)

type ScaleResource

type ScaleResource struct {
	MetricName string `json:"metricName,omitempty"`
	WindowSize string `json:"windowSize,omitempty"`
	Threshold  int    `json:"threshold"`
}

type ScaleToZeroSpec

type ScaleToZeroSpec struct {
	ScaleResources []ScaleResource `json:"scaleResources,omitempty"`
}

type ScaleToZeroStatus

type ScaleToZeroStatus struct {
	LastScaleEvent     scalertypes.ScaleEvent `json:"lastScaleEvent,omitempty"`
	LastScaleEventTime *time.Time             `json:"lastScaleEventTime,omitempty"`
}

type Scrubber

type Scrubber struct {
	*common.AbstractScrubber
}

func NewScrubber

func NewScrubber(parentLogger logger.Logger, sensitiveFields []*regexp.Regexp, kubeClientSet kubernetes.Interface) *Scrubber

NewScrubber returns a new scrubber

func (*Scrubber) ConvertMapToConfig

func (s *Scrubber) ConvertMapToConfig(mapConfig interface{}) (interface{}, error)

func (*Scrubber) RestoreFunctionConfig

func (s *Scrubber) RestoreFunctionConfig(ctx context.Context,
	functionConfig *Config,
	platformName string) (*Config, error)

RestoreFunctionConfig restores a function config from a secret, in case we're running in a kube platform

func (*Scrubber) ScrubFunctionConfig

func (s *Scrubber) ScrubFunctionConfig(ctx context.Context,
	functionConfig *Config) (*Config, error)

ScrubFunctionConfig scrubs function config and creates a secret with scrubbed data

func (*Scrubber) ValidateReference

func (s *Scrubber) ValidateReference(objectToScrub interface{},
	existingSecretMap map[string]string,
	fieldPath,
	secretKey,
	stringValue string) error

type Spec

type Spec struct {
	Description             string                  `json:"description,omitempty"`
	Disable                 bool                    `json:"disable,omitempty"`
	Publish                 bool                    `json:"publish,omitempty"`
	Handler                 string                  `json:"handler,omitempty"`
	Runtime                 string                  `json:"runtime,omitempty"`
	Env                     []v1.EnvVar             `json:"env,omitempty"`
	EnvFrom                 []v1.EnvFromSource      `json:"envFrom,omitempty"`
	Resources               v1.ResourceRequirements `json:"resources,omitempty"`
	Image                   string                  `json:"image,omitempty"`
	ImageHash               string                  `json:"imageHash,omitempty"`
	Replicas                *int                    `json:"replicas,omitempty"`
	MinReplicas             *int                    `json:"minReplicas,omitempty"`
	MaxReplicas             *int                    `json:"maxReplicas,omitempty"`
	TargetCPU               int                     `json:"targetCPU,omitempty"`
	DataBindings            map[string]DataBinding  `json:"dataBindings,omitempty"`
	Triggers                map[string]Trigger      `json:"triggers,omitempty"`
	Volumes                 []Volume                `json:"volumes,omitempty"`
	Version                 int                     `json:"version,omitempty"`
	Alias                   string                  `json:"alias,omitempty"`
	Build                   Build                   `json:"build,omitempty"`
	RunRegistry             string                  `json:"runRegistry,omitempty"`
	ImagePullSecrets        string                  `json:"imagePullSecrets,omitempty"`
	RuntimeAttributes       map[string]interface{}  `json:"runtimeAttributes,omitempty"`
	LoggerSinks             []LoggerSink            `json:"loggerSinks,omitempty"`
	DealerURI               string                  `json:"dealerURI,omitempty"`
	Platform                Platform                `json:"platform,omitempty"`
	ReadinessTimeoutSeconds int                     `json:"readinessTimeoutSeconds,omitempty"`
	ServiceType             v1.ServiceType          `json:"serviceType,omitempty"`
	ImagePullPolicy         v1.PullPolicy           `json:"imagePullPolicy,omitempty"`
	SecurityContext         *v1.PodSecurityContext  `json:"securityContext,omitempty"`
	ServiceAccount          string                  `json:"serviceAccount,omitempty"`
	ScaleToZero             *ScaleToZeroSpec        `json:"scaleToZero,omitempty"`

	// If set to nil, the value is taken from the platform configuration. When set explicitly in function config, it has a priority
	DisableDefaultHTTPTrigger *bool `json:"disableDefaultHTTPTrigger,omitempty"`

	// When set to true, the function spec would not be scrubbed
	DisableSensitiveFieldsMasking bool `json:"disableSensitiveFieldsMasking,omitempty"`

	// Used for local platform functions mounting specific devices
	// https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities
	// E.g.: /dev/video0:/dev/video0 or /dev/video0:/dev/video0:rwm or /dev/fuse
	Devices []string `json:"devices,omitempty"`

	// Run function on a particular set of node(s)
	// https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/
	Affinity     *v1.Affinity      `json:"affinity,omitempty"`
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
	NodeName     string            `json:"nodeName,omitempty"`

	// Allow function to run on a node with matching taint
	// https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/
	Tolerations []v1.Toleration `json:"tolerations,omitempty"`

	// Priority and Preemption
	PriorityClassName string               `json:"priorityClassName,omitempty"`
	PreemptionPolicy  *v1.PreemptionPolicy `json:"preemptionPolicy,omitempty"`

	// How to replace existing function pods with new ones
	DeploymentStrategy *appsv1.DeploymentStrategy `json:"deploymentStrategy,omitempty"`

	// Use the host's ipc namespace
	HostIPC bool `json:"hostIPC,omitempty"`

	// Scale function's replica (when min < max replicas) based on given custom metric specs
	CustomScalingMetricSpecs []autosv2.MetricSpec `json:"customScalingMetricSpecs,omitempty"`
	AutoScaleMetrics         []AutoScaleMetric    `json:"autoScaleMetrics,omitempty"`

	// WaitReadinessTimeoutBeforeFailure is relevant only for k8s platform
	// if true - wait the whole ReadinessTimeoutSeconds before marking this function as unhealthy
	// otherwise, fail the function instantly when there is indication of deployment failure (e.g. pod stuck on crash
	// loop, pod container exited with an error, pod is unschedulable).
	// Default: false
	WaitReadinessTimeoutBeforeFailure bool `json:"waitReadinessTimeoutBeforeFailure,omitempty"`

	// We're letting users write "20s" and not the default marshalled time.Duration
	// (Which is in nanoseconds)
	EventTimeout string `json:"eventTimeout"`

	// PreemptionMode is a mode to allow the user to allow running function pods on preemptible nodes
	// When filled, tolerations, node labels, and affinity would be populated correspondingly to
	// the platformconfig.PreemptibleNodes values.
	PreemptionMode RunOnPreemptibleNodeMode `json:"preemptionMode,omitempty"`

	// Sidecars are containers that run alongside the function container in the same pod
	// the configuration for each sidecar is the same as k8s containers
	Sidecars []*v1.Container `json:"sidecars,omitempty"`

	// InitContainers are specialized containers that run before app containers in a Pod
	// Init containers can contain utilities or setup scripts not present in an app image
	InitContainers []*v1.Container `json:"initContainers,omitempty"`
}

Spec holds all parameters related to a function's configuration

func (*Spec) DeepCopyInto

func (s *Spec) DeepCopyInto(out *Spec)

DeepCopyInto to appease k8s

func (*Spec) GetEventTimeout

func (s *Spec) GetEventTimeout() (time.Duration, error)

GetEventTimeout returns the event timeout as time.Duration

func (*Spec) GetHTTPPort

func (s *Spec) GetHTTPPort() int

GetHTTPPort returns the HTTP port

func (*Spec) PositiveGPUResourceLimit

func (s *Spec) PositiveGPUResourceLimit() bool

PositiveGPUResourceLimit returns whether function requested at least one GPU

type Status

type Status struct {
	State       FunctionState            `json:"state,omitempty"`
	Message     string                   `json:"message,omitempty"`
	Logs        []map[string]interface{} `json:"logs,omitempty"`
	ScaleToZero *ScaleToZeroStatus       `json:"scaleToZero,omitempty"`
	APIGateways []string                 `json:"apiGateways,omitempty"`
	HTTPPort    int                      `json:"httpPort,omitempty"`

	// the built and pushed image name, populated by the function operator after the function has been deployed
	ContainerImage string `json:"containerImage,omitempty"`

	// list of internal urls
	// e.g.:
	//		Kubernetes 	-	[ my-namespace.my-function.svc.cluster.local:8080 ]
	//		Docker 		-	[ function-container-name:8080 ]
	InternalInvocationURLs []string `json:"internalInvocationUrls,omitempty"`

	// list of external urls, containing ingresses and external-ip:function-port
	// e.g.: [ my-function.some-domain.com/pathA, other-ingress.some-domain.co, 1.2.3.4:3000 ]
	ExternalInvocationURLs []string `json:"externalInvocationUrls,omitempty"`

	// node selector from function config enriched with project's and platform node selectors
	EnrichedNodeSelector map[string]string `json:"enrichedNodeSelector,omitempty"`
}

Status holds the status of the function

func (*Status) DeepCopyInto

func (s *Status) DeepCopyInto(out *Status)

DeepCopyInto copies to appease k8s

func (*Status) InvocationURLs

func (s *Status) InvocationURLs() []string

type Trigger

type Trigger struct {
	Class       string            `json:"class"`
	Kind        string            `json:"kind"`
	Name        string            `json:"name"`
	Disabled    bool              `json:"disabled,omitempty"`
	NumWorkers  int               `json:"numWorkers,omitempty"`
	URL         string            `json:"url,omitempty"`
	Paths       []string          `json:"paths,omitempty"`
	Username    string            `json:"username,omitempty"`
	Password    string            `json:"password,omitempty"`
	Secret      string            `json:"secret,omitempty"`
	Partitions  []Partition       `json:"partitions,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty"`

	// TODO: move all these params to attributes for kafka trigger
	WorkerTerminationTimeout              string          `json:"workerTerminationTimeout,omitempty"`
	WorkerAvailabilityTimeoutMilliseconds *int            `json:"workerAvailabilityTimeoutMilliseconds,omitempty"`
	WorkerAllocatorName                   string          `json:"workerAllocatorName,omitempty"`
	ExplicitAckMode                       ExplicitAckMode `json:"explicitAckMode,omitempty"`
	WaitExplicitAckDuringRebalanceTimeout string          `json:"waitExplicitAckDuringRebalanceTimeout,omitempty"`

	Batch *BatchConfiguration `json:"batch,omitempty"`
	// Dealer Information
	TotalTasks        int `json:"total_tasks,omitempty"`
	MaxTaskAllocation int `json:"max_task_allocation,omitempty"`

	// General attributes
	Attributes map[string]interface{} `json:"attributes,omitempty"`

	Mode TriggerWorkMode `json:"mode,omitempty"`

	// Deprecated: MaxWorkers is replaced by NumWorkers, and will be removed in 1.15.x
	// TODO: remove in 1.15.x
	MaxWorkers int `json:"maxWorkers,omitempty"`
}

Trigger holds configuration for a trigger

func GetDefaultHTTPTrigger

func GetDefaultHTTPTrigger() Trigger

type TriggerWorkMode

type TriggerWorkMode string
const (
	SyncTriggerWorkMode  TriggerWorkMode = "sync"
	AsyncTriggerWorkMode TriggerWorkMode = "async"
)

type Volume

type Volume struct {
	Volume      v1.Volume      `json:"volume,omitempty"`
	VolumeMount v1.VolumeMount `json:"volumeMount,omitempty"`
}

Volume stores simple volume and mount

Jump to

Keyboard shortcuts

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