pipelines

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientPipelineRunner

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

ClientPipelineRunner uses a split client to run pipelines.

func NewRunner

func NewRunner(c client.Client) *ClientPipelineRunner

NewRunner creates a new PipelineRunner that creates PipelineRuns with the provided client.

func (*ClientPipelineRunner) Run

func (c *ClientPipelineRunner) Run(ctx context.Context, pipelineName, ns, serviceAccountName string, params []pipelinev1.Param, res []pipelinev1.PipelineResourceBinding, ws []pipelinev1.WorkspaceBinding) (*pipelinev1.PipelineRun, error)

Run is an implementation of the PipelineRunner interface. TODO: This should replaced by TriggerTemplates/TriggerBindings.

type MockRunner

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

MockRunner is a mock pipeline runner that returns fixed responses to runs.

func NewMockRunner

func NewMockRunner(t *testing.T) *MockRunner

NewMockRunner creates and returns a new mock PipelineRunner.

func (*MockRunner) AssertNoPipelineRuns added in v0.1.0

func (m *MockRunner) AssertNoPipelineRuns()

AssertNoPipelineRuns fails if there were any pipelines executed.

func (*MockRunner) AssertPipelineRun

func (m *MockRunner) AssertPipelineRun(pipelineName, ns string, serviceAccountName string, wantParams []pipelinev1.Param, wantResources []pipelinev1.PipelineResourceBinding, wantWorkspaces []pipelinev1.WorkspaceBinding)

AssertPipelineRun ensures that the pipeline run was triggered.

func (*MockRunner) FailWithError

func (m *MockRunner) FailWithError(err error)

FailWithError configures the poller to return errors.

func (*MockRunner) Run

func (m *MockRunner) Run(ctx context.Context, pipelineName, ns, serviceAccountName string, params []pipelinev1.Param, res []pipelinev1.PipelineResourceBinding, ws []pipelinev1.WorkspaceBinding) (*pipelinev1.PipelineRun, error)

Run is an implementation of the PipelineRunner interface.

type PipelineRunner

type PipelineRunner interface {
	Run(ctx context.Context, pipelineName, ns, serviceAccountName string, params []pipelinev1.Param, res []pipelinev1.PipelineResourceBinding, ws []pipelinev1.WorkspaceBinding) (*pipelinev1.PipelineRun, error)
}

PipelineRunner executes a pipeline by name, creating a PipelineRun with the correct params and resource bindings.

Jump to

Keyboard shortcuts

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