Documentation
¶
Index ¶
- Variables
- func Add(_ context.Context, c *config.Config, mgr manager.Manager) error
- func NewReconciler(c *config.Config, mgr manager.Manager, ownerRef setOwnerReferenceFunc) reconcile.Reconciler
- type ImageBuildRunner
- type ImageBuildRunnerFactory
- type ReconcileBuildRun
- func (r *ReconcileBuildRun) GetBuildRunObject(ctx context.Context, objectName string, objectNS string, ...) error
- func (r *ReconcileBuildRun) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)
- func (r *ReconcileBuildRun) VerifyRequestName(ctx context.Context, request reconcile.Request, buildRun *buildapi.BuildRun)
- type TektonPipelineRunImageBuildRunnerFactory
- func (f *TektonPipelineRunImageBuildRunnerFactory) CreateImageBuildRunner(ctx context.Context, client client.Client, cfg *config.Config, ...) (ImageBuildRunner, error)
- func (f *TektonPipelineRunImageBuildRunnerFactory) CreateImageBuildRunnerInCluster(ctx context.Context, client client.Client, runner ImageBuildRunner) error
- func (f *TektonPipelineRunImageBuildRunnerFactory) GetImageBuildRunner(ctx context.Context, client client.Client, namespacedName types.NamespacedName) (ImageBuildRunner, error)
- func (f *TektonPipelineRunImageBuildRunnerFactory) NewImageBuildRunner() ImageBuildRunner
- type TektonPipelineRunWrapper
- func (t *TektonPipelineRunWrapper) Cancel(ctx context.Context, c client.Client) error
- func (t *TektonPipelineRunWrapper) GetCompletionTime() *metav1.Time
- func (t *TektonPipelineRunWrapper) GetCondition(conditionType apis.ConditionType) *apis.Condition
- func (t *TektonPipelineRunWrapper) GetCreationTimestamp() metav1.Time
- func (t *TektonPipelineRunWrapper) GetExecutorKind() string
- func (t *TektonPipelineRunWrapper) GetLabels() map[string]string
- func (t *TektonPipelineRunWrapper) GetName() string
- func (t *TektonPipelineRunWrapper) GetObject() client.Object
- func (t *TektonPipelineRunWrapper) GetPodName() string
- func (t *TektonPipelineRunWrapper) GetResults(ctx context.Context, client client.Client) []pipelineapi.TaskRunResult
- func (t *TektonPipelineRunWrapper) GetStartTime() *metav1.Time
- func (t *TektonPipelineRunWrapper) GetUnderlyingTaskRuns(client client.Client) ([]*pipelineapi.TaskRun, error)
- func (t *TektonPipelineRunWrapper) IsCancelled() bool
- type TektonTaskRunImageBuildRunnerFactory
- func (f *TektonTaskRunImageBuildRunnerFactory) CreateImageBuildRunner(ctx context.Context, client client.Client, cfg *config.Config, ...) (ImageBuildRunner, error)
- func (f *TektonTaskRunImageBuildRunnerFactory) CreateImageBuildRunnerInCluster(ctx context.Context, client client.Client, taskRunner ImageBuildRunner) error
- func (f *TektonTaskRunImageBuildRunnerFactory) GetImageBuildRunner(ctx context.Context, client client.Client, namespacedName types.NamespacedName) (ImageBuildRunner, error)
- func (f *TektonTaskRunImageBuildRunnerFactory) NewImageBuildRunner() ImageBuildRunner
- type TektonTaskRunWrapper
- func (t *TektonTaskRunWrapper) Cancel(ctx context.Context, c client.Client) error
- func (t *TektonTaskRunWrapper) GetCompletionTime() *metav1.Time
- func (t *TektonTaskRunWrapper) GetCondition(conditionType apis.ConditionType) *apis.Condition
- func (t *TektonTaskRunWrapper) GetCreationTimestamp() metav1.Time
- func (t *TektonTaskRunWrapper) GetExecutorKind() string
- func (t *TektonTaskRunWrapper) GetLabels() map[string]string
- func (t *TektonTaskRunWrapper) GetName() string
- func (t *TektonTaskRunWrapper) GetObject() client.Object
- func (t *TektonTaskRunWrapper) GetPodName() string
- func (t *TektonTaskRunWrapper) GetResults(_ context.Context, _ client.Client) []pipelineapi.TaskRunResult
- func (t *TektonTaskRunWrapper) GetStartTime() *metav1.Time
- func (t *TektonTaskRunWrapper) GetUnderlyingTaskRuns(_ client.Client) ([]*pipelineapi.TaskRun, error)
- func (t *TektonTaskRunWrapper) IsCancelled() bool
Constants ¶
This section is empty.
Variables ¶
var RunnerFactories = map[string]ImageBuildRunnerFactory{ "PipelineRun": &TektonPipelineRunImageBuildRunnerFactory{}, "TaskRun": &TektonTaskRunImageBuildRunnerFactory{}, }
Available image build runners for a buildrun.
Functions ¶
func Add ¶
Add creates a new BuildRun Controller and adds it to the Manager. The Manager will set fields on the Controller and Start it when the Manager is Started.
func NewReconciler ¶
func NewReconciler(c *config.Config, mgr manager.Manager, ownerRef setOwnerReferenceFunc) reconcile.Reconciler
NewReconciler returns a new reconcile.Reconciler
Types ¶
type ImageBuildRunner ¶ added in v0.17.0
type ImageBuildRunner interface {
// GetName returns the name of the build runner.
GetName() string
// GetLabels returns the labels of the build runner.
GetLabels() map[string]string
// GetCreationTimestamp returns the creation timestamp of the build runner.
GetCreationTimestamp() metav1.Time
// GetResults returns the results of the build runner.
GetResults(ctx context.Context, client client.Client) []pipelineapi.TaskRunResult
// GetCondition returns the condition of the build runner.
GetCondition(conditionType apis.ConditionType) *apis.Condition
// GetStartTime returns the start time of the build runner.
GetStartTime() *metav1.Time
// GetCompletionTime returns the completion time of the build runner.
GetCompletionTime() *metav1.Time
// GetPodName returns the pod name of the build runner.
GetPodName() string
// IsCancelled returns true if the build runner is cancelled.
IsCancelled() bool
// Cancel cancels the execution of the build runner.
Cancel(ctx context.Context, client client.Client) error
// GetObject returns the underlying client.Object for owner reference operations.
GetObject() client.Object
// GetExecutorKind returns the kind of executor (e.g., "TaskRun", "PipelineRun").
GetExecutorKind() string
// GetUnderlyingTaskRun returns the generated TaskRun from using either TaskRun or PipelineRun.
GetUnderlyingTaskRuns(client client.Client) ([]*pipelineapi.TaskRun, error)
}
ImageBuildRunner defines an interface for building a container image.
type ImageBuildRunnerFactory ¶ added in v0.17.0
type ImageBuildRunnerFactory interface {
// NewImageBuildRunner creates a new empty ImageBuildRunner.
NewImageBuildRunner() ImageBuildRunner
// CreateImageBuildRunner creates an ImageBuildRunner instance from build configuration. It does not create the ImageBuildRunner in the API server.
CreateImageBuildRunner(ctx context.Context, client client.Client, cfg *config.Config, serviceAccount *corev1.ServiceAccount, strategy buildapi.BuilderStrategy, build *buildapi.Build, buildRun *buildapi.BuildRun, scheme *runtime.Scheme, setOwnerRef setOwnerReferenceFunc) (ImageBuildRunner, error)
// GetImageBuildRunner retrieves an ImageBuildRunner from the API server.
GetImageBuildRunner(ctx context.Context, client client.Client, namespacedName types.NamespacedName) (ImageBuildRunner, error)
// CreateImageBuildRunnerInCluster creates the ImageBuildRunner in the API server.
CreateImageBuildRunnerInCluster(ctx context.Context, client client.Client, taskRunner ImageBuildRunner) error
}
ImageBuildRunnerFactory defines methods for creating and manipulating ImageBuildRunners.
type ReconcileBuildRun ¶
type ReconcileBuildRun struct {
// contains filtered or unexported fields
}
ReconcileBuildRun reconciles a BuildRun object
func (*ReconcileBuildRun) GetBuildRunObject ¶
func (r *ReconcileBuildRun) GetBuildRunObject(ctx context.Context, objectName string, objectNS string, buildRun *buildapi.BuildRun) error
GetBuildRunObject retrieves an existing BuildRun based on a name and namespace
func (*ReconcileBuildRun) Reconcile ¶
func (r *ReconcileBuildRun) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)
Reconcile reads that state of the cluster for a Build object and makes changes based on the state read and what is in the Build.Spec
func (*ReconcileBuildRun) VerifyRequestName ¶
func (r *ReconcileBuildRun) VerifyRequestName(ctx context.Context, request reconcile.Request, buildRun *buildapi.BuildRun)
VerifyRequestName parse a Reconcile request name and looks for an associated BuildRun name If the BuildRun object exists and is not yet completed, it will update it with an error.
type TektonPipelineRunImageBuildRunnerFactory ¶ added in v0.18.0
type TektonPipelineRunImageBuildRunnerFactory struct{}
TektonPipelineRunImageBuildRunnerFactory implements ImageBuildRunnerFactory for Tekton PipelineRuns.
func (*TektonPipelineRunImageBuildRunnerFactory) CreateImageBuildRunner ¶ added in v0.18.0
func (f *TektonPipelineRunImageBuildRunnerFactory) CreateImageBuildRunner(ctx context.Context, client client.Client, cfg *config.Config, serviceAccount *corev1.ServiceAccount, strategy buildapi.BuilderStrategy, build *buildapi.Build, buildRun *buildapi.BuildRun, scheme *runtime.Scheme, setOwnerRef setOwnerReferenceFunc) (ImageBuildRunner, error)
CreateImageBuildRunner creates an ImageBuildRunner instance from build configuration.
func (*TektonPipelineRunImageBuildRunnerFactory) CreateImageBuildRunnerInCluster ¶ added in v0.18.0
func (f *TektonPipelineRunImageBuildRunnerFactory) CreateImageBuildRunnerInCluster(ctx context.Context, client client.Client, runner ImageBuildRunner) error
CreateImageBuildRunnerInCluster creates the ImageBuildRunner in the API server.
func (*TektonPipelineRunImageBuildRunnerFactory) GetImageBuildRunner ¶ added in v0.18.0
func (f *TektonPipelineRunImageBuildRunnerFactory) GetImageBuildRunner(ctx context.Context, client client.Client, namespacedName types.NamespacedName) (ImageBuildRunner, error)
GetImageBuildRunner retrieves an ImageBuildRunner from the API server.
func (*TektonPipelineRunImageBuildRunnerFactory) NewImageBuildRunner ¶ added in v0.18.0
func (f *TektonPipelineRunImageBuildRunnerFactory) NewImageBuildRunner() ImageBuildRunner
NewImageBuildRunner creates a new empty ImageBuildRunner for a PipelineRun.
type TektonPipelineRunWrapper ¶ added in v0.18.0
type TektonPipelineRunWrapper struct {
PipelineRun *pipelineapi.PipelineRun
}
TektonPipelineRunWrapper wraps pipelineapi.PipelineRun to implement the ImageBuildRunner interface.
func (*TektonPipelineRunWrapper) Cancel ¶ added in v0.18.0
Cancel cancels the PipelineRun by setting its status to cancelled.
func (*TektonPipelineRunWrapper) GetCompletionTime ¶ added in v0.18.0
func (t *TektonPipelineRunWrapper) GetCompletionTime() *metav1.Time
GetCompletionTime returns the completion time of the PipelineRun.
func (*TektonPipelineRunWrapper) GetCondition ¶ added in v0.18.0
func (t *TektonPipelineRunWrapper) GetCondition(conditionType apis.ConditionType) *apis.Condition
GetCondition returns the condition with the specified type.
func (*TektonPipelineRunWrapper) GetCreationTimestamp ¶ added in v0.18.0
func (t *TektonPipelineRunWrapper) GetCreationTimestamp() metav1.Time
GetCreationTimestamp returns the creation timestamp of the PipelineRun.
func (*TektonPipelineRunWrapper) GetExecutorKind ¶ added in v0.18.0
func (t *TektonPipelineRunWrapper) GetExecutorKind() string
GetExecutorKind returns the kind of executor.
func (*TektonPipelineRunWrapper) GetLabels ¶ added in v0.18.0
func (t *TektonPipelineRunWrapper) GetLabels() map[string]string
GetLabels returns the labels of the PipelineRun.
func (*TektonPipelineRunWrapper) GetName ¶ added in v0.18.0
func (t *TektonPipelineRunWrapper) GetName() string
GetName returns the name of the PipelineRun.
func (*TektonPipelineRunWrapper) GetObject ¶ added in v0.18.0
func (t *TektonPipelineRunWrapper) GetObject() client.Object
GetObject returns the underlying client.Object for owner reference operations.
func (*TektonPipelineRunWrapper) GetPodName ¶ added in v0.18.0
func (t *TektonPipelineRunWrapper) GetPodName() string
func (*TektonPipelineRunWrapper) GetResults ¶ added in v0.18.0
func (t *TektonPipelineRunWrapper) GetResults(ctx context.Context, client client.Client) []pipelineapi.TaskRunResult
GetResults returns the PipelineRun results converted to TaskRun results. For PipelineRuns, we need to extract results from the underlying TaskRuns since results are typically written by individual TaskRuns, not by the PipelineRun itself.
func (*TektonPipelineRunWrapper) GetStartTime ¶ added in v0.18.0
func (t *TektonPipelineRunWrapper) GetStartTime() *metav1.Time
GetStartTime returns the start time of the PipelineRun.
func (*TektonPipelineRunWrapper) GetUnderlyingTaskRuns ¶ added in v0.18.0
func (t *TektonPipelineRunWrapper) GetUnderlyingTaskRuns(client client.Client) ([]*pipelineapi.TaskRun, error)
GetUnderlyingTaskRuns returns the actual TaskRun from the child references in the PipelineRun.
func (*TektonPipelineRunWrapper) IsCancelled ¶ added in v0.18.0
func (t *TektonPipelineRunWrapper) IsCancelled() bool
IsCancelled returns true if the PipelineRun is cancelled.
type TektonTaskRunImageBuildRunnerFactory ¶ added in v0.17.0
type TektonTaskRunImageBuildRunnerFactory struct{}
TektonTaskRunImageBuildRunnerFactory implements ImageBuildRunnerFactory for Tekton TaskRuns
func (*TektonTaskRunImageBuildRunnerFactory) CreateImageBuildRunner ¶ added in v0.17.0
func (f *TektonTaskRunImageBuildRunnerFactory) CreateImageBuildRunner(ctx context.Context, client client.Client, cfg *config.Config, serviceAccount *corev1.ServiceAccount, strategy buildapi.BuilderStrategy, build *buildapi.Build, buildRun *buildapi.BuildRun, scheme *runtime.Scheme, setOwnerRef setOwnerReferenceFunc) (ImageBuildRunner, error)
CreateImageBuildRunner creates an ImageBuildRunner instance from build configuration. It does not create the ImageBuildRunner in the API server.
func (*TektonTaskRunImageBuildRunnerFactory) CreateImageBuildRunnerInCluster ¶ added in v0.17.0
func (f *TektonTaskRunImageBuildRunnerFactory) CreateImageBuildRunnerInCluster(ctx context.Context, client client.Client, taskRunner ImageBuildRunner) error
CreateImageBuildRunnerInCluster creates an ImageBuildRunner in the API server.
func (*TektonTaskRunImageBuildRunnerFactory) GetImageBuildRunner ¶ added in v0.17.0
func (f *TektonTaskRunImageBuildRunnerFactory) GetImageBuildRunner(ctx context.Context, client client.Client, namespacedName types.NamespacedName) (ImageBuildRunner, error)
GetImageBuildRunner retrieves an ImageBuildRunner from the API server.
func (*TektonTaskRunImageBuildRunnerFactory) NewImageBuildRunner ¶ added in v0.17.0
func (f *TektonTaskRunImageBuildRunnerFactory) NewImageBuildRunner() ImageBuildRunner
NewImageBuildRunner creates a new empty TaskRunner
type TektonTaskRunWrapper ¶ added in v0.17.0
type TektonTaskRunWrapper struct {
TaskRun *pipelineapi.TaskRun
}
TektonTaskRunWrapper wraps pipelineapi.TaskRun to implement the ImageBuildRunner interface.
func (*TektonTaskRunWrapper) Cancel ¶ added in v0.17.0
Cancel cancels the TaskRun by setting its status to cancelled
func (*TektonTaskRunWrapper) GetCompletionTime ¶ added in v0.17.0
func (t *TektonTaskRunWrapper) GetCompletionTime() *metav1.Time
GetCompletionTime returns the completion time of the TaskRun
func (*TektonTaskRunWrapper) GetCondition ¶ added in v0.17.0
func (t *TektonTaskRunWrapper) GetCondition(conditionType apis.ConditionType) *apis.Condition
GetCondition returns the condition with the specified type
func (*TektonTaskRunWrapper) GetCreationTimestamp ¶ added in v0.17.0
func (t *TektonTaskRunWrapper) GetCreationTimestamp() metav1.Time
GetCreationTimestamp returns the creation timestamp of the TaskRun
func (*TektonTaskRunWrapper) GetExecutorKind ¶ added in v0.18.0
func (t *TektonTaskRunWrapper) GetExecutorKind() string
GetExecutorKind returns the kind of executor. to set the kind of executor field for the build run
func (*TektonTaskRunWrapper) GetLabels ¶ added in v0.17.0
func (t *TektonTaskRunWrapper) GetLabels() map[string]string
GetLabels returns the labels of the TaskRun
func (*TektonTaskRunWrapper) GetName ¶ added in v0.17.0
func (t *TektonTaskRunWrapper) GetName() string
GetName returns the name of the TaskRun
func (*TektonTaskRunWrapper) GetObject ¶ added in v0.17.0
func (t *TektonTaskRunWrapper) GetObject() client.Object
GetObject returns the underlying client.Object for owner reference operations
func (*TektonTaskRunWrapper) GetPodName ¶ added in v0.17.0
func (t *TektonTaskRunWrapper) GetPodName() string
GetPodName returns the pod name of the TaskRun
func (*TektonTaskRunWrapper) GetResults ¶ added in v0.17.0
func (t *TektonTaskRunWrapper) GetResults(_ context.Context, _ client.Client) []pipelineapi.TaskRunResult
GetResults returns the TaskRun results
func (*TektonTaskRunWrapper) GetStartTime ¶ added in v0.17.0
func (t *TektonTaskRunWrapper) GetStartTime() *metav1.Time
GetStartTime returns the start time of the TaskRun
func (*TektonTaskRunWrapper) GetUnderlyingTaskRuns ¶ added in v0.18.0
func (t *TektonTaskRunWrapper) GetUnderlyingTaskRuns(_ client.Client) ([]*pipelineapi.TaskRun, error)
GetUnderlyingTaskRun returns the underlying TaskRun.
func (*TektonTaskRunWrapper) IsCancelled ¶ added in v0.17.0
func (t *TektonTaskRunWrapper) IsCancelled() bool
IsCancelled returns true if the TaskRun is cancelled