tekton

package
v0.41.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

static const namespace for deployement when everything else fails

Variables

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

	BuildpackTaskURL string
	S2ITaskURL       string
	DeployTaskURL    string
)
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(namespace string) (*v1beta1.TektonV1beta1Client, string, error)

NewTektonClientAndResolvedNamespace returns TektonV1beta1Client,namespace,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