cfg

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext added in v0.39.0

func NewContext(ctx context.Context, factory k8s.ClientFactory) context.Context

NewContext creates a new context witch a factory which can be used to load th pipeline run configuration. The config is only loaded when it is accessed

func NewContextWithConfig added in v0.39.0

func NewContextWithConfig(ctx context.Context, config *PipelineRunsConfigStruct) context.Context

NewContextWithConfig creates a context containing a pipeline run configuration

Types

type PipelineRunsConfigStruct

type PipelineRunsConfigStruct struct {
	// Timeout is the maximum execution time of a pipeline run.
	// If `nil`, a default timeout should be used.
	Timeout *metav1.Duration

	// TimeoutWait is the maximum time a pipeline run can stay in state waiting
	// before it is stopped with timeout error.
	// If `nil`, the timeout is set to 10 minutes.
	TimeoutWait *metav1.Duration

	// The manifest (in YAML format) of a Kubernetes LimitRange object to be
	// applied to each pipeline run sandbox namespace.
	// If empty, no limit range will be defined.
	LimitRange string

	// The manifest (in YAML format) of a Kubernetes ResourceQuota object to be
	// applied to each pipeline run sandbox namespace.
	// If empty, no resource quota will be defined.
	ResourceQuota string

	// CustomLoggingDetails refers to a function that provides custom logging
	// details extracted from a pipeline run object.
	CustomLoggingDetails customlog.LoggingDetailsProvider

	// JenkinsfileRunnerImage is the Jenkinsfile Runner container image to be
	// used for pipeline runs.
	// If empty, a default image will be used.
	JenkinsfileRunnerImage string

	// JenkinsfileRunnerImagePullPolicy is the pull policy for the container
	// image defined by `JenkinsfileRunnerImage`.
	// It defaults to `IfNotPresent`.
	// If `JenkinsfileRunnerImage` is not set, this value is not used (it does
	// not apply to the default image).
	JenkinsfileRunnerImagePullPolicy string

	// JenkinsfileRunnerPodSecurityContextRunAsUser is the numerical user id
	// the Jenkinsfile Runner process is started as.
	JenkinsfileRunnerPodSecurityContextRunAsUser *int64

	// JenkinsfileRunnerPodSecurityContextRunAsGroup is the numerical group id
	// the Jenkinsfile Runner process is started as.
	JenkinsfileRunnerPodSecurityContextRunAsGroup *int64

	// JenkinsfileRunnerPodSecurityContextFSGroup is the numerical filesystem
	// group id the Jenkinsfile Runner pod will use.
	JenkinsfileRunnerPodSecurityContextFSGroup *int64

	// DefaultNetworkProfile is the name of the network profile that should
	// be used in case the user has not explicitly chosen one.
	DefaultNetworkProfile string

	// NetworkPolicies maps network profile names to network policies.
	// Each value is a Kubernetes network policy manifest in YAML format.
	NetworkPolicies map[string]string

	// TektonTaskName is the name of the Tekton task to run the
	// Jenkinsfile Runner pod.
	TektonTaskName string

	// TektonTaskNamespace is the name of the namespace containing
	// the Tekton task to run the Jenkinsfile Runner.
	TektonTaskNamespace string
}

PipelineRunsConfigStruct is a struct holding the pipeline runs configuration.

func FromContext added in v0.39.0

func FromContext(ctx context.Context) (*PipelineRunsConfigStruct, error)

FromContext returns the pipeline run configuration when available in the context. Returns nil/nil if configuration is not contained in the context. Returns an error when configuration cannot be loaded.

func LoadPipelineRunsConfig

func LoadPipelineRunsConfig(ctx context.Context, clientFactory k8s.ClientFactory) (*PipelineRunsConfigStruct, error)

LoadPipelineRunsConfig loads the pipeline run's configuration and returns it.

Jump to

Keyboard shortcuts

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