Documentation ¶
Index ¶
- Constants
- Variables
- func NewTektonClientAndResolvedNamespace(defaultNamespace string) (*v1beta1.TektonV1beta1Client, string, 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, error)
Constants ¶
const (
DefaultWaitingTimeout = 120 * time.Second
)
Variables ¶
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" )
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.
Functions ¶
func NewTektonClientAndResolvedNamespace ¶
func NewTektonClientAndResolvedNamespace(defaultNamespace string) (*v1beta1.TektonV1beta1Client, string, error)
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 WithNamespace ¶
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 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.