provisioners

package
v0.62.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package provisioners contains the definitions of the different provisioners that can be used in a test to setup an environment.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Diagnosable

type Diagnosable interface {
	Diagnose(ctx context.Context, stackName string) (string, error)
}

Diagnosable defines the interface for a diagnosable provider.

type FileProvisioner

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

FileProvisioner is a provisioner that reads JSON files from a filesystem.

func NewFileProvisioner

func NewFileProvisioner(id string, fs fs.FS) *FileProvisioner

NewFileProvisioner returns a new FileProvisioner.

func (*FileProvisioner) Destroy

Destroy is a no-op for the FileProvisioner.

func (*FileProvisioner) ID

func (fp *FileProvisioner) ID() string

ID returns the ID of the provisioner.

func (*FileProvisioner) Provision

Provision reads JSON files from the filesystem and returns them as raw resources.

type Provisioner

type Provisioner interface {
	ID() string
	Destroy(context.Context, string, io.Writer) error
}

Provisioner defines the interface for a provisioner.

type ProvisionerMap

type ProvisionerMap map[string]Provisioner

ProvisionerMap is a map of provisioners.

func CopyProvisioners

func CopyProvisioners(in ProvisionerMap) ProvisionerMap

CopyProvisioners copies a map of provisioners

type PulumiEnvRunFunc

type PulumiEnvRunFunc[Env any] func(ctx *pulumi.Context, env *Env) error

PulumiEnvRunFunc is a function that runs a Pulumi program with a given environment.

type PulumiProvisioner

type PulumiProvisioner[Env any] struct {
	// contains filtered or unexported fields
}

PulumiProvisioner is a provisioner based on Pulumi with binding to an environment.

func NewTypedPulumiProvisioner

func NewTypedPulumiProvisioner[Env any](id string, runFunc PulumiEnvRunFunc[Env], configMap runner.ConfigMap) *PulumiProvisioner[Env]

NewTypedPulumiProvisioner returns a new PulumiProvisioner.

func NewUntypedPulumiProvisioner

func NewUntypedPulumiProvisioner(id string, runFunc pulumi.RunFunc, configMap runner.ConfigMap) *PulumiProvisioner[any]

NewUntypedPulumiProvisioner returns a new PulumiProvisioner without env binding.

func (*PulumiProvisioner[Env]) Destroy

func (pp *PulumiProvisioner[Env]) Destroy(ctx context.Context, stackName string, logger io.Writer) error

Destroy deletes the Pulumi stack.

func (*PulumiProvisioner[Env]) Diagnose

func (pp *PulumiProvisioner[Env]) Diagnose(ctx context.Context, stackName string) (string, error)

Diagnose runs the diagnose function if it is set diagnoseFunc

func (*PulumiProvisioner[Env]) ID

func (pp *PulumiProvisioner[Env]) ID() string

ID returns the ID of the provisioner.

func (*PulumiProvisioner[Env]) Provision

func (pp *PulumiProvisioner[Env]) Provision(ctx context.Context, stackName string, logger io.Writer) (RawResources, error)

Provision runs the Pulumi program and returns the raw resources.

func (*PulumiProvisioner[Env]) ProvisionEnv

func (pp *PulumiProvisioner[Env]) ProvisionEnv(ctx context.Context, stackName string, logger io.Writer, env *Env) (RawResources, error)

ProvisionEnv runs the Pulumi program with a given environment and returns the raw resources.

func (*PulumiProvisioner[Env]) SetDiagnoseFunc

func (pp *PulumiProvisioner[Env]) SetDiagnoseFunc(diagnoseFunc func(ctx context.Context, stackName string) (string, error))

SetDiagnoseFunc sets the diagnose function.

type RawResources

type RawResources map[string][]byte

RawResources is the common types returned by provisioners

func (RawResources) Merge

func (rr RawResources) Merge(in RawResources)

Merge merges two RawResources maps

type TypedProvisioner

type TypedProvisioner[Env any] interface {
	Provisioner
	ProvisionEnv(context.Context, string, io.Writer, *Env) (RawResources, error)
}

TypedProvisioner defines the interface for a provisioner with env binding

type UntypedProvisioner

type UntypedProvisioner interface {
	Provisioner
	Provision(context.Context, string, io.Writer) (RawResources, error)
}

UntypedProvisioner defines the interface for a provisioner without env binding

Directories

Path Synopsis
aws
docker
Package awsdocker contains the definition of the AWS Docker environment.
Package awsdocker contains the definition of the AWS Docker environment.
ecs
Package ecs contains the definition of the AWS ECS environment.
Package ecs contains the definition of the AWS ECS environment.
host
Package awshost contains the definition of the AWS Host environment.
Package awshost contains the definition of the AWS Host environment.
host/windows
Package winawshost contains the definition of the AWS Windows Host environment.
Package winawshost contains the definition of the AWS Windows Host environment.
kubernetes
Package awskubernetes contains the provisioner for the Kubernetes based environments
Package awskubernetes contains the provisioner for the Kubernetes based environments
azure
host/linux
Package azurehost contains the definition of the Azure Host environment.
Package azurehost contains the definition of the Azure Host environment.
host/windows
Package winazurehost contains the definition of the Azure Windows Host environment.
Package winazurehost contains the definition of the Azure Windows Host environment.
kubernetes
Package azurekubernetes contains the provisioner for Azure Kubernetes Service (AKS)
Package azurekubernetes contains the provisioner for Azure Kubernetes Service (AKS)
gcp
host/linux
Package gcphost contains the definition of the GCP Host environment.
Package gcphost contains the definition of the GCP Host environment.
kubernetes
Package gcpkubernetes contains the provisioner for Google Kubernetes Engine (GKE)
Package gcpkubernetes contains the provisioner for Google Kubernetes Engine (GKE)
local
host
Package localhost contains the provisioner for the local Host based environments
Package localhost contains the provisioner for the local Host based environments
kubernetes
Package localkubernetes contains the provisioner for the local Kubernetes based environments
Package localkubernetes contains the provisioner for the local Kubernetes based environments

Jump to

Keyboard shortcuts

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