controllers

package
v0.0.0-...-958d37d Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Done

func Done() (ctrl.Result, error)

func RequeueOnError

func RequeueOnError(err error) (ctrl.Result, error)

Types

type Clock

type Clock interface {
	Now() time.Time
}

type CustomRunReconciler

type CustomRunReconciler struct {
	client.Client                 // kubernetes client
	Scheme        *runtime.Scheme // shared scheme
	Clock                         // local clock instance
}

CustomRunReconciler watches over Tekton CustomRun instances carrying a Shipwright Build reference, that's the approach Tekton takes to Custom-Tasks, which makes possible to utilize third-party controller resources.

func NewCustomRunReconciler

func NewCustomRunReconciler(
	ctrlClient client.Client,
	scheme *runtime.Scheme,
) *CustomRunReconciler

NewCustomRunReconciler instantiate the CustomRunReconciler.

func (*CustomRunReconciler) Reconcile

func (r *CustomRunReconciler) Reconcile(
	ctx context.Context,
	req ctrl.Request,
) (ctrl.Result, error)

Reconcile reconciles the Custom-Tasks Run instances pointing to Shipwright Builds, by issuing a BuildRun and taking advantage of Status.ExtraFields to record the BuildRun namespace/name. When the ExtraFields is populated the controller uses the reference to reflect the BuildRun status updates on the original Run instance.

func (*CustomRunReconciler) SetupWithManager

func (r *CustomRunReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager instantiate this controller using controller runtime manager.

type InventoryReconciler

type InventoryReconciler struct {
	client.Client                 // kubernetes client
	Scheme        *runtime.Scheme // shared scheme
	Clock                         // local clock instance
	// contains filtered or unexported fields
}

InventoryReconciler reconciles Build instances on the Inventory.

func NewInventoryReconciler

func NewInventoryReconciler(
	ctrlClient client.Client,
	scheme *runtime.Scheme,
	buildInventory *inventory.Inventory,
) *InventoryReconciler

NewInventoryReconciler instantiate the InventoryReconciler.

func (*InventoryReconciler) Reconcile

func (r *InventoryReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile reconciles Build instances reflecting it's status on the Inventory.

func (*InventoryReconciler) SetupWithManager

func (r *InventoryReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager uses the manager to watch over Builds.

type PipelineRunReconciler

type PipelineRunReconciler struct {
	client.Client                 // kubernetes client
	Scheme        *runtime.Scheme // shared scheme
	Clock                         // local clock instance
	// contains filtered or unexported fields
}

PipelineRunReconciler reconciles PipelineRun objects that may have triggers configured to generate a BuildRun based on the Pipeline state.

func NewPipelineRunReconciler

func NewPipelineRunReconciler(
	ctrlClient client.Client,
	scheme *runtime.Scheme,
	buildInventory *inventory.Inventory,
) *PipelineRunReconciler

NewPipelineRunReconciler instantiate the PipelineRunReconciler.

func (*PipelineRunReconciler) Reconcile

func (r *PipelineRunReconciler) Reconcile(
	ctx context.Context,
	req ctrl.Request,
) (ctrl.Result, error)

Reconcile inspects the PipelineRun to extract the query parameters for the Build inventory search, and at the end creates the BuildRun instance(s). Before firing the BuildRuns it inspects the PipelineRun to assert the object is being referred by triggers and it's not part of a Custom-Task Pipeline.

func (*PipelineRunReconciler) SetupWithManager

func (r *PipelineRunReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager uses the manager to watch over PipelineRuns.

Jump to

Keyboard shortcuts

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