tekton

package
v0.40.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var (
	FuncRepoRef       = "knative/func"
	FuncRepoBranchRef = "main"

	BuildpackTaskURL = taskBasePath + "func-buildpacks/0.2/func-buildpacks.yaml"
	S2ITaskURL       = taskBasePath + "func-s2i/0.1/func-s2i.yaml"
	DeployTaskURL    = taskBasePath + "func-deploy/0.1/func-deploy.yaml"
)
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.

Functions

func NewTektonClientAndResolvedNamespace

func NewTektonClientAndResolvedNamespace(defaultNamespace string) (*v1beta1.TektonV1beta1Client, string, error)

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 WithNamespace

func WithNamespace(namespace string) 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 creates a Tekton Pipeline and all necessary resources (PVCs, Secrets, SAs,...) for the input Function. It ensures that all needed resources are present on the cluster so the PipelineRun can be initialized. After the PipelineRun is being initialized, the progress of the PipelineRun is being watched and printed to the output.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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