probe

package
v0.0.0-...-dc1648f Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedKind = errors.New("unsupported kind")

ErrUnsupportedKind informed kind is not supported.

Functions

func RawTektonParamsToTypedSlice

func RawTektonParamsToTypedSlice(rawParams []string) ([]v1beta1.Param, error)

RawTektonParamsToTypedSlice parses the informed slice of strings as typed Tekton Params.

Types

type PipelineProbe

type PipelineProbe struct {
	// contains filtered or unexported fields
}

PipelineProbe runs a Pipeline until completion.

func NewPipelineProbe

func NewPipelineProbe(
	cfg *config.Config,
	wbs []v1beta1.WorkspaceBinding,
	prs []v1beta1.Param,
) *PipelineProbe

NewPipelineProbe instantiates the PipelineProbe.

func (*PipelineProbe) Run

func (p *PipelineProbe) Run(ctx context.Context, name string) (*Subject, error)

Run runs the PipelineRun until completion, caputures the coordinates on the returned Subject.

type Probe

type Probe interface {
	// Run runs the resource until completion.
	Run(_ context.Context, _ string) (*Subject, error)
}

Probe able to instantiate and run a Tekton resource, which will be subject to assertion later on.

func NewProbe

func NewProbe(cfg *config.Config, kind string, rawWorkspaces, rawParams []string) (Probe, error)

NewProbe instantiates a Probe based on the informed kind, the raw workspaces and params are parsed and informed to the new instance.

type Subject

type Subject struct {
	GVR      schema.GroupVersionResource // kubernetes GVR
	Fullname types.NamespacedName        // resource namespace and name
}

Subject defines the coordinates of the Kubernetes (Tekton) resource to be "subject" of probing and assertion.

func NewSubject

func NewSubject(gv schema.GroupVersionResource, fullname types.NamespacedName) *Subject

NewSubject instantiate the Subject.

func (*Subject) Name

func (s *Subject) Name() string

Name short access to subject's name.

func (*Subject) Namespace

func (s *Subject) Namespace() string

Name short access to subject's namespace.

type TaskProbe

type TaskProbe struct {
	// contains filtered or unexported fields
}

TaskProbe runs and follows a TaskRun instance.

func NewTaskProbe

func NewTaskProbe(
	cfg *config.Config,
	wbs []v1beta1.WorkspaceBinding,
	prs []v1beta1.Param,
) *TaskProbe

NewTaskProbe instantiate a TaskProbe with requirements.

func (*TaskProbe) Run

func (p *TaskProbe) Run(ctx context.Context, name string) (*Subject, error)

Run uses the informed (task) name to generate and create a TaskRun instance, following up its progress until completion.

Jump to

Keyboard shortcuts

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