runner

package
v0.0.13-alpha1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	Namespace       string `json:"namespace,omitempty"`
	SecretSuffix    string `json:"secret_suffix,omitempty"`
	InClusterConfig string `json:"in_cluster_config,omitempty"`
}

type Config

type Config struct {
	Terraform `json:"terraform,omitempty"`
}

type Runner

type Runner struct {
	Action    string
	Namespace string
	Execution *v1.Execution
	GitAuth   *git.Auth
	K8sClient *kubernetes.Clientset

	VarSecret *coreV1.Secret
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner(config *rest.Config) (*Runner, error)

NewRunner returns a runner with the k8s clients populated

func (*Runner) Create

func (r *Runner) Create() (string, error)

Create will create resources through terraform. If the execution AutoConfirm flag is set it will run 'plan' then 'apply', if the flag is not set 'plan' will run then the job will wait for the approved annotation to be set then the job will run 'apply' or exit.

func (*Runner) DeleteJob

func (r *Runner) DeleteJob() error

func (*Runner) Destroy

func (r *Runner) Destroy() (string, error)

Destroy will destroy resources through terraform. If the execution AutoConfirm flag is set it will run 'destroy', if the flag is not set 'destroy' will run then the job will wait for the approved approved to be set then the job will run 'destroy' or exit

func (*Runner) Populate

func (r *Runner) Populate() error

Populate attempts to grab all resources needed for running

func (*Runner) SaveOutputs

func (r *Runner) SaveOutputs() error

func (*Runner) SetExecutionLogs

func (r *Runner) SetExecutionLogs(s string) error

func (*Runner) SetExecutionRunStatus

func (r *Runner) SetExecutionRunStatus(s string) error

func (*Runner) TerraformInit

func (r *Runner) TerraformInit() (string, error)

TerraformInit runs the terraform init command

func (*Runner) WriteConfigFile

func (r *Runner) WriteConfigFile() error

func (*Runner) WriteVarFile

func (r *Runner) WriteVarFile() error

type Terraform

type Terraform struct {
	Backend map[string]*Backend `json:"backend,omitempty"`
}

Jump to

Keyboard shortcuts

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