Documentation ¶
Overview ¶
Package jobexecutor package
Index ¶
Constants ¶
const ( AnsiBoldRed = "\033[31;1m" AnsiBoldGreen = "\033[32;1m" AnsiBoldCyan = "\033[36;1m" AnsiReset = "\033[0;m" )
ANSI color constants for job log output
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplyHandler ¶
type ApplyHandler struct {
// contains filtered or unexported fields
}
ApplyHandler handles an apply job
func NewApplyHandler ¶
func NewApplyHandler( cancellableCtx context.Context, jobCfg *JobConfig, workspaceDir string, workspace *types.Workspace, run *types.Run, jobLogger *jobLogger, client Client, ) *ApplyHandler
NewApplyHandler creates a new ApplyHandler
func (*ApplyHandler) Execute ¶
func (a *ApplyHandler) Execute(ctx context.Context) error
Execute will execute the job
type Client ¶
type Client interface { GetRun(ctx context.Context, id string) (*types.Run, error) GetJob(ctx context.Context, id string) (*types.Job, error) GetWorkspace(ctx context.Context, id string) (*types.Workspace, error) GetRunVariables(ctx context.Context, runID string) ([]types.RunVariable, error) GetAssignedManagedIdentities(ctx context.Context, workspaceID string) ([]types.ManagedIdentity, error) GetConfigurationVersion(ctx context.Context, id string) (*types.ConfigurationVersion, error) CreateStateVersion(ctx context.Context, runID string, body io.Reader) (*types.StateVersion, error) CreateManagedIdentityCredentials(ctx context.Context, managedIdentityID string) ([]byte, error) CreateTerraformCLIDownloadURL(ctx context.Context, input *types.CreateTerraformCLIDownloadURLInput) (string, error) SaveJobLogs(ctx context.Context, jobID string, startOffset int, buffer []byte) error SubscribeToJobCancellationEvent(ctx context.Context, jobID string) (<-chan *types.CancellationEvent, error) UpdateApply(ctx context.Context, apply *types.Apply) (*types.Apply, error) UpdatePlan(ctx context.Context, apply *types.Plan) (*types.Plan, error) UploadPlanCache(ctx context.Context, plan *types.Plan, body io.Reader) error DownloadConfigurationVersion(ctx context.Context, configurationVersion *types.ConfigurationVersion, writer io.WriterAt) error DownloadStateVersion(ctx context.Context, stateVersion *types.StateVersion, writer io.WriterAt) error DownloadPlanCache(ctx context.Context, planID string, writer io.WriterAt) error Close() error }
Client interface is used by the Job Executor to interface with the Tharsis API
type JobConfig ¶
type JobConfig struct { JobID string APIEndpoint string JobToken string DiscoveryProtocolHost string }
JobConfig is used to configure the job
type JobExecutor ¶
type JobExecutor struct {
// contains filtered or unexported fields
}
JobExecutor executes a job
func NewJobExecutor ¶
func NewJobExecutor( cfg *JobConfig, client Client, logger logger.Logger, ) *JobExecutor
NewJobExecutor creates a new JobExecutor
type JobHandler ¶
type JobHandler interface { Execute(ctx context.Context) error OnError(ctx context.Context, err error) error OnSuccess(ctx context.Context) error }
JobHandler contains the job lifecycle functions
type LogBuffer ¶
type LogBuffer struct {
// contains filtered or unexported fields
}
LogBuffer stores logs in a file and limits the amount of logs written
type MemoryMonitor ¶ added in v0.4.0
MemoryMonitor implements all memory monitor functions. The methods should be called in the order shown here. GetMaxMemoryUsage can be called multiple times if desired.
func NewMemoryMonitor ¶ added in v0.4.0
func NewMemoryMonitor(jobLogger *jobLogger, memoryLimit uint64) (MemoryMonitor, error)
NewMemoryMonitor creates an instance of the memory monitor.
type PlanHandler ¶
type PlanHandler struct {
// contains filtered or unexported fields
}
PlanHandler handles a plan job
func NewPlanHandler ¶
func NewPlanHandler( cancellableCtx context.Context, jobCfg *JobConfig, workspaceDir string, workspace *types.Workspace, run *types.Run, jobLogger *jobLogger, client Client, ) *PlanHandler
NewPlanHandler creates a new PlanHandler
func (*PlanHandler) Execute ¶
func (p *PlanHandler) Execute(ctx context.Context) error
Execute will execute the job
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package managedidentity package
|
Package managedidentity package |
awsfederated
Package awsfederated package
|
Package awsfederated package |
azurefederated
Package azurefederated package
|
Package azurefederated package |
tharsisfederated
Package tharsisfederated package
|
Package tharsisfederated package |