jobs

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultServiceAccount = "terranetes-executor"

DefaultServiceAccount is the default service account to use for the job if no override is given

View Source
const TerraformContainerName = "terraform"

TerraformContainerName is the default name for the main terraform container

Variables

This section is empty.

Functions

func IsActive

func IsActive(job *batchv1.Job) bool

IsActive returns true if the job is active

func IsComplete

func IsComplete(job *batchv1.Job) bool

IsComplete returns true if the job has succeeded

func IsFailed

func IsFailed(job *batchv1.Job) bool

IsFailed returns true of the job has failed

Types

type Options

type Options struct {
	// AdditionalJobAnnotations are additional annotations added to the job
	AdditionalJobAnnotations map[string]string
	// AdditionalJobSecret is a collection of secrets which should be mounted into the job.
	AdditionalJobSecrets []string
	// AdditionalJobLabels are additional labels added to the job
	AdditionalJobLabels map[string]string
	// BackoffLimit is the number of times we are willing to allow a job to fail
	// before we give up
	BackoffLimit int
	// EnableInfraCosts is the flag to enable cost analysis
	EnableInfraCosts bool
	// ExecutorImage is the image to use for the terraform jobs
	ExecutorImage string
	// ExecutorSecrets is a list of additional secrets to add to the job
	ExecutorSecrets []string
	// InfracostsImage is the image to use for infracosts
	InfracostsImage string
	// InfracostsSecret is the name of the secret contain the infracost token and url
	InfracostsSecret string
	// Namespace is the location of the jobs
	Namespace string
	// PolicyConstraint is a matching constraint for this policy
	PolicyConstraint *terraformv1alpha1.PolicyConstraint
	// PolicyImage is image to use for checkov
	PolicyImage string
	// SaveTerraformState indicates we should save the terraform state in a secret
	SaveTerraformState bool
	// Template is the source for the job template if overridden by the controller
	Template []byte
	// TerraformImage is the image to use for the terraform jobs
	TerraformImage string
}

Options is the configuration for the render

type Render

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

Render is responsible for rendering the terraform configuration

func New

func New(configuration *terraformv1alpha1.Configuration, provider *terraformv1alpha1.Provider) *Render

New returns a new render job

func (*Render) NewJobWatch

func (r *Render) NewJobWatch(namespace, stage string, executorImage string) *batchv1.Job

NewJobWatch is responsible for creating a job watch pod

func (*Render) NewTerraformApply

func (r *Render) NewTerraformApply(options Options) (*batchv1.Job, error)

NewTerraformApply is responsible for creating a batch job to run terraform apply

func (*Render) NewTerraformDestroy

func (r *Render) NewTerraformDestroy(options Options) (*batchv1.Job, error)

NewTerraformDestroy is responsible for creating a batch job to run terraform destroy

func (*Render) NewTerraformPlan

func (r *Render) NewTerraformPlan(options Options) (*batchv1.Job, error)

NewTerraformPlan is responsible for creating a batch job to run terraform plan

Jump to

Keyboard shortcuts

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