provisioner

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const GlobalStreamGroupName = "portersvr"

GlobalStreamGroupName is the name of the Redis consumer group that this server is a part of

View Source
const GlobalStreamName = "global"

GlobalStreamName is the name of the Redis stream for global operations

Variables

This section is empty.

Functions

func GlobalStreamListener

func GlobalStreamListener(
	client *redis.Client,
	repo repository.Repository,
	errorChan chan error,
)

GlobalStreamListener performs an XREADGROUP operation on a given stream and updates models in the database as necessary

func InitGlobalStream

func InitGlobalStream(client *redis.Client) error

InitGlobalStream initializes the global stream if it does not exist, and the global consumer group if it does not exist

func ResourceStream

func ResourceStream(client *redis.Client, streamName string, conn *websocket.Conn) error

ResourceStream performs an XREAD operation on the given stream and outputs it to the given websocket conn.

Types

type Conf

type Conf struct {
	Kind                InfraOption
	Name                string
	Namespace           string
	ID                  string
	Redis               *config.RedisConf
	Postgres            *config.DBConf
	Operation           ProvisionerOperation
	ProvisionerImageTag string
	LastApplied         []byte

	// AWS
	AWS *aws.Conf
	ECR *ecr.Conf
	EKS *eks.Conf

	// GKE
	GCP *gcp.Conf
	GKE *gke.Conf

	// DO
	DO   *do.Conf
	DOCR *docr.Conf
	DOKS *doks.Conf
}

Conf is the config required to start a provisioner container

func (*Conf) GetProvisionerJobTemplate

func (conf *Conf) GetProvisionerJobTemplate() (*batchv1.Job, error)

GetProvisionerJobTemplate returns the manifest that should be applied to create a provisioning job

func (*Conf) GetRedisStreamID

func (conf *Conf) GetRedisStreamID() string

GetRedisStreamID returns the stream id that should be used

func (*Conf) GetTFWorkspaceID

func (conf *Conf) GetTFWorkspaceID() string

GetTFWorkspaceID returns the workspace id that should be used

type InfraOption

type InfraOption string

InfraOption is a type of infrastructure that can be provisioned

const (
	Test InfraOption = "test"
	ECR  InfraOption = "ecr"
	EKS  InfraOption = "eks"
	GCR  InfraOption = "gcr"
	GKE  InfraOption = "gke"
	DOCR InfraOption = "docr"
	DOKS InfraOption = "doks"
)

The list of infra options

type ProvisionerOperation

type ProvisionerOperation string
const (
	Apply   ProvisionerOperation = "apply"
	Destroy ProvisionerOperation = "destroy"
)

type ResourceCRUDHandler

type ResourceCRUDHandler interface {
	OnCreate(id uint) error
}

ResourceCRUDHandler is a handler for updates to an infra resource

Directories

Path Synopsis
aws
ecr
eks
do
gcp
gke

Jump to

Keyboard shortcuts

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