job

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package job is a generated GoMock package.

Package job is a generated GoMock package.

Index

Constants

View Source
const Dummy = "Dummy"

Dummy is used to represent the ignition config for the dummy ISO that is kicked off in inventory.go to pull the base ISO image when the service starts up. It is also used to detect if the image should be uploaded to S3. The dummy image is not uploaded to S3.

Variables

This section is empty.

Functions

func New

func New(log logrus.FieldLogger, kube client.Client, cfg Config) *kubeJob

func NewLocalJob

func NewLocalJob(log logrus.FieldLogger, cfg Config) *localJob

Types

type API

type API interface {
	// Create k8s job
	Create(ctx context.Context, obj runtime.Object, opts ...client.CreateOption) error
	// Monitor k8s job return error in case job fails
	Monitor(ctx context.Context, name, namespace string) error
	// Delete k8s job
	Delete(ctx context.Context, name, namespace string, force bool) error
	generator.ISOInstallConfigGenerator
}

type Config

type Config struct {
	MonitorLoopInterval time.Duration `envconfig:"JOB_MONITOR_INTERVAL" default:"500ms"`
	RetryInterval       time.Duration `envconfig:"JOB_RETRY_INTERVAL" default:"1s"`
	RetryAttempts       int           `envconfig:"JOB_RETRY_ATTEMPTS" default:"30"`
	ImageBuilder        string        `envconfig:"IMAGE_BUILDER" default:"quay.io/ocpmetal/assisted-iso-create:latest"`
	Namespace           string        `envconfig:"NAMESPACE" default:"assisted-installer"`
	S3EndpointURL       string        `envconfig:"S3_ENDPOINT_URL" default:"http://10.35.59.36:30925"`
	S3Bucket            string        `envconfig:"S3_BUCKET" default:"test"`
	S3Region            string        `envconfig:"S3_REGION"`
	AwsAccessKeyID      string        `envconfig:"AWS_ACCESS_KEY_ID" default:"accessKey1"`
	AwsSecretAccessKey  string        `envconfig:"AWS_SECRET_ACCESS_KEY" default:"verySecretKey1"`
	JobCPULimit         string        `envconfig:"JOB_CPU_LIMIT" default:"500m"`
	JobMemoryLimit      string        `envconfig:"JOB_MEMORY_LIMIT" default:"1000Mi"`
	JobCPURequests      string        `envconfig:"JOB_CPU_REQUESTS" default:"300m"`
	JobMemoryRequests   string        `envconfig:"JOB_MEMORY_REQUESTS" default:"400Mi"`
	IgnitionGenerator   string        `envconfig:"IGNITION_GENERATE_IMAGE" default:"quay.io/ocpmetal/assisted-ignition-generator:latest"` // TODO: update the latest once the repository has git workflow
	ServiceBaseURL      string        `envconfig:"SERVICE_BASE_URL"`
	//[TODO] -  change the default of Releae image to "", once everyine wll update their environment
	SubsystemRun         bool   `envconfig:"SUBSYSTEM_RUN"`
	ReleaseImage         string `` /* 167-byte string literal not displayed */
	SkipCertVerification bool   `envconfig:"SKIP_CERT_VERIFICATION" default:"false"`
}

type LocalJob

type LocalJob interface {
	Execute(pythonCommand string, pythonFilePath string, envVars []string, log logrus.FieldLogger) error
	generator.ISOInstallConfigGenerator
}

type MockAPI

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

MockAPI is a mock of API interface

func NewMockAPI

func NewMockAPI(ctrl *gomock.Controller) *MockAPI

NewMockAPI creates a new mock instance

func (*MockAPI) AbortInstallConfig

func (m *MockAPI) AbortInstallConfig(ctx context.Context, cluster common.Cluster) error

AbortInstallConfig mocks base method

func (*MockAPI) Create

func (m *MockAPI) Create(ctx context.Context, obj runtime.Object, opts ...client.CreateOption) error

Create mocks base method

func (*MockAPI) Delete

func (m *MockAPI) Delete(ctx context.Context, name, namespace string, force bool) error

Delete mocks base method

func (*MockAPI) EXPECT

func (m *MockAPI) EXPECT() *MockAPIMockRecorder

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

func (*MockAPI) GenerateISO

func (m *MockAPI) GenerateISO(ctx context.Context, cluster common.Cluster, jobName, imageName, ignitionConfig string, eventsHandler events.Handler) error

GenerateISO mocks base method

func (*MockAPI) GenerateInstallConfig

func (m *MockAPI) GenerateInstallConfig(ctx context.Context, cluster common.Cluster, cfg []byte) error

GenerateInstallConfig mocks base method

func (*MockAPI) Monitor

func (m *MockAPI) Monitor(ctx context.Context, name, namespace string) error

Monitor mocks base method

type MockAPIMockRecorder

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

MockAPIMockRecorder is the mock recorder for MockAPI

func (*MockAPIMockRecorder) AbortInstallConfig

func (mr *MockAPIMockRecorder) AbortInstallConfig(ctx, cluster interface{}) *gomock.Call

AbortInstallConfig indicates an expected call of AbortInstallConfig

func (*MockAPIMockRecorder) Create

func (mr *MockAPIMockRecorder) Create(ctx, obj interface{}, opts ...interface{}) *gomock.Call

Create indicates an expected call of Create

func (*MockAPIMockRecorder) Delete

func (mr *MockAPIMockRecorder) Delete(ctx, name, namespace, force interface{}) *gomock.Call

Delete indicates an expected call of Delete

func (*MockAPIMockRecorder) GenerateISO

func (mr *MockAPIMockRecorder) GenerateISO(ctx, cluster, jobName, imageName, ignitionConfig, eventsHandler interface{}) *gomock.Call

GenerateISO indicates an expected call of GenerateISO

func (*MockAPIMockRecorder) GenerateInstallConfig

func (mr *MockAPIMockRecorder) GenerateInstallConfig(ctx, cluster, cfg interface{}) *gomock.Call

GenerateInstallConfig indicates an expected call of GenerateInstallConfig

func (*MockAPIMockRecorder) Monitor

func (mr *MockAPIMockRecorder) Monitor(ctx, name, namespace interface{}) *gomock.Call

Monitor indicates an expected call of Monitor

type MockLocalJob

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

MockLocalJob is a mock of LocalJob interface

func NewMockLocalJob

func NewMockLocalJob(ctrl *gomock.Controller) *MockLocalJob

NewMockLocalJob creates a new mock instance

func (*MockLocalJob) AbortInstallConfig

func (m *MockLocalJob) AbortInstallConfig(ctx context.Context, cluster common.Cluster) error

AbortInstallConfig mocks base method

func (*MockLocalJob) EXPECT

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

func (*MockLocalJob) Execute

func (m *MockLocalJob) Execute(pythonCommand, pythonFilePath string, envVars []string, log logrus.FieldLogger) error

Execute mocks base method

func (*MockLocalJob) GenerateISO

func (m *MockLocalJob) GenerateISO(ctx context.Context, cluster common.Cluster, jobName, imageName, ignitionConfig string, eventsHandler events.Handler) error

GenerateISO mocks base method

func (*MockLocalJob) GenerateInstallConfig

func (m *MockLocalJob) GenerateInstallConfig(ctx context.Context, cluster common.Cluster, cfg []byte) error

GenerateInstallConfig mocks base method

type MockLocalJobMockRecorder

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

MockLocalJobMockRecorder is the mock recorder for MockLocalJob

func (*MockLocalJobMockRecorder) AbortInstallConfig

func (mr *MockLocalJobMockRecorder) AbortInstallConfig(ctx, cluster interface{}) *gomock.Call

AbortInstallConfig indicates an expected call of AbortInstallConfig

func (*MockLocalJobMockRecorder) Execute

func (mr *MockLocalJobMockRecorder) Execute(pythonCommand, pythonFilePath, envVars, log interface{}) *gomock.Call

Execute indicates an expected call of Execute

func (*MockLocalJobMockRecorder) GenerateISO

func (mr *MockLocalJobMockRecorder) GenerateISO(ctx, cluster, jobName, imageName, ignitionConfig, eventsHandler interface{}) *gomock.Call

GenerateISO indicates an expected call of GenerateISO

func (*MockLocalJobMockRecorder) GenerateInstallConfig

func (mr *MockLocalJobMockRecorder) GenerateInstallConfig(ctx, cluster, cfg interface{}) *gomock.Call

GenerateInstallConfig indicates an expected call of GenerateInstallConfig

Jump to

Keyboard shortcuts

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