terraform

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: Apache-2.0 Imports: 53 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JobTypeApply   = "apply"
	JobTypeDestroy = "destroy"
)
View Source
const (
	WalrusMetadataProjectName     = "walrus_metadata_project_name"
	WalrusMetadataEnvironmentName = "walrus_metadata_environment_name"
	WalrusMetadataServiceName     = "walrus_metadata_service_name"
	WalrusMetadataProjectID       = "walrus_metadata_project_id"
	WalrusMetadataEnvironmentID   = "walrus_metadata_environment_id"
	WalrusMetadataServiceID       = "walrus_metadata_service_id"
	// WalrusMetadataNamespaceName is the managed namespace name of an environment,
	// valid when Kubernetes connector is used in the environment.
	WalrusMetadataNamespaceName = "walrus_metadata_namespace_name"
)

walrus metadata indicate walrus will set value to these attribute while user module include these attribute.

View Source
const DeployerType = types.DeployerTypeTF

DeployerType the type of deployer.

Variables

Functions

func CreateJob

func CreateJob(ctx context.Context, clientSet *kubernetes.Clientset, opts JobCreateOptions) error

CreateJob create a job to run terraform deployment.

func CreateSecret

func CreateSecret(ctx context.Context, clientSet *kubernetes.Clientset, name string, data map[string][]byte) error

CreateSecret create a secret to store terraform config.

func StreamJobLogs

func StreamJobLogs(ctx context.Context, opts StreamJobLogsOptions) error

StreamJobLogs streams the logs of a job.

func SyncServiceRevisionStatus

func SyncServiceRevisionStatus(ctx context.Context, bm revisionbus.BusMessage) (err error)

SyncServiceRevisionStatus updates the status of the service according to its recent finished service revision.

Types

type Deployer

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

Deployer terraform deployer to deploy the service.

func (Deployer) Apply

func (d Deployer) Apply(ctx context.Context, service *model.Service, opts deptypes.ApplyOptions) (err error)

Apply creates a new service revision by the given service, and drives the Kubernetes Job to create resources of the service.

func (Deployer) Destroy

func (d Deployer) Destroy(ctx context.Context, service *model.Service, opts deptypes.DestroyOptions) (err error)

Destroy creates a new service revision by the given service, and drives the Kubernetes Job to clean the resources of the service.

func (Deployer) Type

func (d Deployer) Type() deptypes.Type

type JobCreateOptions

type JobCreateOptions struct {
	// Type is the deployment type of job, apply or destroy or other.
	Type              string
	ServiceRevisionID string
	Image             string
	Env               []corev1.EnvVar
}

type JobReconciler

type JobReconciler struct {
	Logger      logr.Logger
	Kubeconfig  *rest.Config
	KubeClient  client.Client
	ModelClient *model.Client
}

func (JobReconciler) Reconcile

func (r JobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (JobReconciler) Setup

func (r JobReconciler) Setup(mgr ctrl.Manager) error

type StreamJobLogsOptions

type StreamJobLogsOptions struct {
	Cli        *coreclient.CoreV1Client
	RevisionID object.ID
	JobType    string
	Out        io.Writer
}

Jump to

Keyboard shortcuts

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