dynamic

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AfterDeletion added in v0.8.0

type AfterDeletion func(ctx context.Context, object results.Object) error

AfterDeletion is the function called after object is deleted

type IsReadyForDeletion added in v0.6.0

type IsReadyForDeletion func(ctx context.Context, object results.Object) (bool, error)

IsReadyForDeletion is a predicate function which indicates whether the object being reconciled is ready to be garbage collected. Besides the reqirements that are already enforced by this reconciler, callers may define more specific constraints by providing a function that has the below signature to the Reconciler instance. For instance, the controller that reconciles PipelineRuns can verify whether all dependent TaskRuns are up to date in the API server before deleting all objects in cascade.

type ObjectClient added in v0.5.0

type ObjectClient interface {
	Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
	Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) error
}

ObjectClient is a shim around generated k8s clients to handle objects in type agnostic ways. This might be able to be replaced with generics later?

type PipelineRunClient added in v0.5.0

type PipelineRunClient struct {
	pipelinev1.PipelineRunInterface
}

PipelineRunClient implements the dynamic ObjectClient for TaskRuns.

func (*PipelineRunClient) Patch added in v0.5.0

func (c *PipelineRunClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) error

Patch patches pipelineRun Kubernetes resource.

type Reconciler

type Reconciler struct {
	// KubeClientSet allows us to talk to the k8s for core APIs
	KubeClientSet kubernetes.Interface

	IsReadyForDeletionFunc IsReadyForDeletion
	AfterDeletion          AfterDeletion
	// contains filtered or unexported fields
}

Reconciler implements common reconciler behavior across different Tekton Run Object types.

func NewDynamicReconciler added in v0.5.0

func NewDynamicReconciler(kubeClientSet kubernetes.Interface, rc pb.ResultsClient, lc pb.LogsClient, oc ObjectClient, cfg *reconciler.Config) *Reconciler

NewDynamicReconciler creates a new dynamic Reconciler.

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, o results.Object) error

Reconcile handles result/record uploading for the given Run object. If enabled, the object may be deleted upon successful result upload.

type TaskRunClient added in v0.5.0

type TaskRunClient struct {
	pipelinev1.TaskRunInterface
}

TaskRunClient implements the dynamic ObjectClient for TaskRuns.

func (*TaskRunClient) Patch added in v0.5.0

func (c *TaskRunClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) error

Patch patches TaskRun k8s resource

Jump to

Keyboard shortcuts

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