tekton

package
v0.44.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultNamespace = "default"

DefaultNamespace is the kubernetes default namespace

View Source
const (
	DefaultWaitingTimeout = 120 * time.Second
)

Variables

View Source
var (
	// ErrRuntimeRequired indicates the required value of Function Runtime was not provided
	ErrRuntimeRequired = errors.New("runtime is required to build")

	ErrBuilpacksNotSupported = errors.New("additional Buildpacks are not supported for on cluster build")
)
View Source
var DefaultPersistentVolumeClaimSize = resource.MustParse("256Mi")

DefaultPersistentVolumeClaimSize to allocate for the function.

View Source
var DeployerImage = "ghcr.io/knative/func-utils:latest"

Functions

func GetClusterTasks added in v0.42.0

func GetClusterTasks() string

GetClusterTasks returns multi-document yaml containing tekton tasks used by func.

func NewTektonClient added in v0.42.0

func NewTektonClient(namespace string) (*v1.TektonV1Client, error)

NewTektonClient returns TektonV1beta1Client for namespace

func NewTektonClients added in v0.38.0

func NewTektonClients() (*cli.Clients, error)

Types

type ErrRuntimeNotSupported

type ErrRuntimeNotSupported struct {
	Runtime string
}

func (ErrRuntimeNotSupported) Error

func (e ErrRuntimeNotSupported) Error() string

type Opt

type Opt func(*PipelinesProvider)

func WithCredentialsProvider

func WithCredentialsProvider(credentialsProvider docker.CredentialsProvider) Opt

func WithPacURLCallback added in v0.38.0

func WithPacURLCallback(getPacURL pacURLCallback) Opt

func WithPipelineDecorator

func WithPipelineDecorator(decorator PipelineDecorator) Opt

func WithVerbose

func WithVerbose(verbose bool) Opt

type PipelineDecorator

type PipelineDecorator interface {
	UpdateLabels(fn.Function, map[string]string) map[string]string
}

type PipelinesProvider

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

func NewPipelinesProvider

func NewPipelinesProvider(opts ...Opt) *PipelinesProvider

func (*PipelinesProvider) ConfigurePAC

func (pp *PipelinesProvider) ConfigurePAC(ctx context.Context, f fn.Function, metadata any) error

ConfigurePAC cofigures Pipelines as Code resources based on the input: - locally (create .tekton directory) - on cluster (create Repository, Secret, PVC...) - on remote git repo (webhook) Parameter `metadata` is type `any` to not bring `pkg/pipelines` package dependency to `pkg/functions`, this specific implementation expects the parameter to be a type `pipelines.PacMetada`.

func (*PipelinesProvider) Remove

func (pp *PipelinesProvider) Remove(ctx context.Context, f fn.Function) error

Remove tries to remove all resources that are present on the cluster and belongs to the input function and it's pipelines

func (*PipelinesProvider) RemovePAC

func (pp *PipelinesProvider) RemovePAC(ctx context.Context, f fn.Function, metadata any) error

RemovePAC tries to remove all local and remote resources that were created for PAC. Resources on the remote GitHub repo are not removed, we would need to store webhook id somewhere locally.

func (*PipelinesProvider) Run

Run a remote build by creating all necessary resources (PVCs, secrets, SAs, etc) specified by the given Function before generating a pipeline definition, sending it to the cluster to be run via Tekton. Progress is by default piped to stdtout. Returned is the final url, and the input Function with the final results of the run populated (f.Deploy.Image and f.Deploy.Namespace) or an error.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳