Documentation
¶
Index ¶
- Constants
- Variables
- func GetClusterTasks() string
- func NewTektonClient(namespace string) (*v1.TektonV1Client, error)
- func NewTektonClients() (*cli.Clients, error)
- type ErrRuntimeNotSupported
- type Opt
- type PipelineDecorator
- type PipelinesProvider
- func (pp *PipelinesProvider) ConfigurePAC(ctx context.Context, f fn.Function, metadata any) error
- func (pp *PipelinesProvider) Remove(ctx context.Context, f fn.Function) error
- func (pp *PipelinesProvider) RemovePAC(ctx context.Context, f fn.Function, metadata any) error
- func (pp *PipelinesProvider) Run(ctx context.Context, f fn.Function) (string, fn.Function, error)
Constants ¶
const DefaultNamespace = "default"
DefaultNamespace is the kubernetes default namespace
const (
DefaultWaitingTimeout = 120 * time.Second
)
Variables ¶
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") )
var DefaultPersistentVolumeClaimSize = resource.MustParse("256Mi")
DefaultPersistentVolumeClaimSize to allocate for the function.
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
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 ¶
type PipelineDecorator ¶
type PipelinesProvider ¶
type PipelinesProvider struct {
// contains filtered or unexported fields
}
func NewPipelinesProvider ¶
func NewPipelinesProvider(opts ...Opt) *PipelinesProvider
func (*PipelinesProvider) ConfigurePAC ¶
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 ¶
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 ¶
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.