builderapi

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Overview

Package builderapi is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrJobNotFound is returned if a job can't be found
	ErrJobNotFound = errors.New("The job can't be found")
)

Functions

This section is empty.

Types

type CiBuilderParams

type CiBuilderParams struct {
	BuilderConfig        contracts.BuilderConfig
	EnvironmentVariables map[string]string
	OperatingSystem      manifest.OperatingSystem
	JobResources         database.JobResources
}

CiBuilderParams contains the parameters required to create a ci builder job

func (*CiBuilderParams) GetFullRepoPath

func (cbp *CiBuilderParams) GetFullRepoPath() string

GetFullRepoPath returns the full path of the pipeline / build / release repository with source, owner and name

type Client

type Client interface {
	CreateCiBuilderJob(ctx context.Context, params CiBuilderParams) (job *batchv1.Job, err error)
	RemoveCiBuilderJob(ctx context.Context, jobName string) (err error)
	CancelCiBuilderJob(ctx context.Context, jobName string) (err error)
	RemoveCiBuilderConfigMap(ctx context.Context, configmapName string) (err error)
	RemoveCiBuilderSecret(ctx context.Context, secretName string) (err error)
	RemoveCiBuilderImagePullSecret(ctx context.Context, secretName string) (err error)
	TailCiBuilderJobLogs(ctx context.Context, jobName string, logChannel chan contracts.TailLogLine) (err error)
	GetJobName(ctx context.Context, jobType contracts.JobType, repoOwner, repoName, id string) (jobname string)
}

Client is the interface for running kubernetes commands specific to this application

func NewClient

func NewClient(config *api.APIConfig, encryptedConfig *api.APIConfig, secretHelper crypt.SecretHelper, kubeClientset *kubernetes.Clientset, dockerHubClient dockerhubapi.Client) Client

NewClient returns a new estafette.Client

func NewLoggingClient

func NewLoggingClient(c Client) Client

NewLoggingClient returns a new instance of a logging Client.

func NewMetricsClient

func NewMetricsClient(c Client, requestCount metrics.Counter, requestLatency metrics.Histogram) Client

NewMetricsClient returns a new instance of a metrics Client.

func NewTracingClient

func NewTracingClient(c Client) Client

NewTracingClient returns a new instance of a tracing Client.

type MockClient

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

MockClient is a mock of Client interface.

func NewMockClient

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance.

func (*MockClient) CancelCiBuilderJob

func (m *MockClient) CancelCiBuilderJob(ctx context.Context, jobName string) error

CancelCiBuilderJob mocks base method.

func (*MockClient) CreateCiBuilderJob

func (m *MockClient) CreateCiBuilderJob(ctx context.Context, params CiBuilderParams) (*v1.Job, error)

CreateCiBuilderJob mocks base method.

func (*MockClient) EXPECT

func (m *MockClient) EXPECT() *MockClientMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockClient) GetJobName

func (m *MockClient) GetJobName(ctx context.Context, jobType estafette_ci_contracts.JobType, repoOwner, repoName, id string) string

GetJobName mocks base method.

func (*MockClient) RemoveCiBuilderConfigMap

func (m *MockClient) RemoveCiBuilderConfigMap(ctx context.Context, configmapName string) error

RemoveCiBuilderConfigMap mocks base method.

func (*MockClient) RemoveCiBuilderImagePullSecret

func (m *MockClient) RemoveCiBuilderImagePullSecret(ctx context.Context, secretName string) error

RemoveCiBuilderImagePullSecret mocks base method.

func (*MockClient) RemoveCiBuilderJob

func (m *MockClient) RemoveCiBuilderJob(ctx context.Context, jobName string) error

RemoveCiBuilderJob mocks base method.

func (*MockClient) RemoveCiBuilderSecret

func (m *MockClient) RemoveCiBuilderSecret(ctx context.Context, secretName string) error

RemoveCiBuilderSecret mocks base method.

func (*MockClient) TailCiBuilderJobLogs

func (m *MockClient) TailCiBuilderJobLogs(ctx context.Context, jobName string, logChannel chan estafette_ci_contracts.TailLogLine) error

TailCiBuilderJobLogs mocks base method.

type MockClientMockRecorder

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

MockClientMockRecorder is the mock recorder for MockClient.

func (*MockClientMockRecorder) CancelCiBuilderJob

func (mr *MockClientMockRecorder) CancelCiBuilderJob(ctx, jobName interface{}) *gomock.Call

CancelCiBuilderJob indicates an expected call of CancelCiBuilderJob.

func (*MockClientMockRecorder) CreateCiBuilderJob

func (mr *MockClientMockRecorder) CreateCiBuilderJob(ctx, params interface{}) *gomock.Call

CreateCiBuilderJob indicates an expected call of CreateCiBuilderJob.

func (*MockClientMockRecorder) GetJobName

func (mr *MockClientMockRecorder) GetJobName(ctx, jobType, repoOwner, repoName, id interface{}) *gomock.Call

GetJobName indicates an expected call of GetJobName.

func (*MockClientMockRecorder) RemoveCiBuilderConfigMap

func (mr *MockClientMockRecorder) RemoveCiBuilderConfigMap(ctx, configmapName interface{}) *gomock.Call

RemoveCiBuilderConfigMap indicates an expected call of RemoveCiBuilderConfigMap.

func (*MockClientMockRecorder) RemoveCiBuilderImagePullSecret

func (mr *MockClientMockRecorder) RemoveCiBuilderImagePullSecret(ctx, secretName interface{}) *gomock.Call

RemoveCiBuilderImagePullSecret indicates an expected call of RemoveCiBuilderImagePullSecret.

func (*MockClientMockRecorder) RemoveCiBuilderJob

func (mr *MockClientMockRecorder) RemoveCiBuilderJob(ctx, jobName interface{}) *gomock.Call

RemoveCiBuilderJob indicates an expected call of RemoveCiBuilderJob.

func (*MockClientMockRecorder) RemoveCiBuilderSecret

func (mr *MockClientMockRecorder) RemoveCiBuilderSecret(ctx, secretName interface{}) *gomock.Call

RemoveCiBuilderSecret indicates an expected call of RemoveCiBuilderSecret.

func (*MockClientMockRecorder) TailCiBuilderJobLogs

func (mr *MockClientMockRecorder) TailCiBuilderJobLogs(ctx, jobName, logChannel interface{}) *gomock.Call

TailCiBuilderJobLogs indicates an expected call of TailCiBuilderJobLogs.

type ZeroLogLine

type ZeroLogLine struct {
	TailLogLine *contracts.TailLogLine `json:"tailLogLine"`
}

Jump to

Keyboard shortcuts

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