stack

package
v0.13.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: Apache-2.0 Imports: 28 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Stdout      = "stdout"
	NoDiffFound = "All resources are reconciled. No diff found"
)

Variables

View Source
var (
	ErrGettingNonExistingStack                   = errors.New("the stack does not exist")
	ErrUpdatingNonExistingStack                  = errors.New("the stack to update does not exist")
	ErrInvalidStackID                            = errors.New("the stack ID should be a uuid")
	ErrCanOnlyUpdateConfigItemInNonStandardStack = errors.New("can only update config item in non-standard stack")
	ErrGettingNonExistingStateForStack           = errors.New("can not find State in this stack")
	ErrNoManagedResourceToDestroy                = errors.New("no managed resources to destroy")
	ErrDryrunApply                               = errors.New("dryrun-mode is enabled, no resources will be applied")
	ErrDryrunDestroy                             = errors.New("dryrun-mode is enabled, no resources will be destroyed")
	ErrStackInOperation                          = errors.New("the stack is being operated by another request. Please wait until it is completed")
	ErrStackNotPreviewedYet                      = errors.New("the stack has not been previewed yet. Please generate and preview the stack first")
)

Functions

func BuildOptions

func BuildOptions(dryrun bool, maxConcurrent int) *engineapi.APIOptions

func GetWorkDirFromSource

func GetWorkDirFromSource(ctx context.Context, stack *entity.Stack, project *entity.Project) (string, string, error)

getWorkDirFromSource returns the workdir based on the source if the source type is local, it will return the path as an absolute path on the local filesystem if the source type is remote (git for example), it will pull the source and return the path to the pulled source

func ProcessChanges

func ProcessChanges(ctx context.Context, w http.ResponseWriter, changes *models.Changes, format string, detail bool) (any, error)

Types

type StackExecuteParams added in v0.13.0

type StackExecuteParams struct {
	Detail          bool
	Dryrun          bool
	SpecID          string
	Force           bool
	ImportResources bool
}

type StackManager

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

func NewStackManager

func NewStackManager(stackRepo repository.StackRepository,
	projectRepo repository.ProjectRepository,
	workspaceRepo repository.WorkspaceRepository,
	resourceRepo repository.ResourceRepository,
	defaultBackend entity.Backend,
	maxConcurrent int,
) *StackManager

func (*StackManager) ApplyStack

func (m *StackManager) ApplyStack(ctx context.Context, params *StackRequestParams, requestPayload request.StackImportRequest) error

func (*StackManager) BuildStackFilter added in v0.13.0

func (m *StackManager) BuildStackFilter(ctx context.Context, orgIDParam, projectIDParam, projectName, envParam string) (*entity.StackFilter, error)

func (*StackManager) CreateStack

func (m *StackManager) CreateStack(ctx context.Context, requestPayload request.CreateStackRequest) (*entity.Stack, error)

func (*StackManager) DeleteStackByID

func (m *StackManager) DeleteStackByID(ctx context.Context, id uint) error

func (*StackManager) DestroyStack

func (m *StackManager) DestroyStack(ctx context.Context, params *StackRequestParams, w http.ResponseWriter) (err error)

func (*StackManager) GenerateSpec added in v0.13.0

func (m *StackManager) GenerateSpec(ctx context.Context, params *StackRequestParams) (string, *apiv1.Spec, error)

func (*StackManager) GetStackByID

func (m *StackManager) GetStackByID(ctx context.Context, id uint) (*entity.Stack, error)

func (*StackManager) ImportTerraformResourceID added in v0.13.0

func (m *StackManager) ImportTerraformResourceID(ctx context.Context, sp *v1.Spec, importedResources map[string]string)

func (*StackManager) ListStacks

func (m *StackManager) ListStacks(ctx context.Context, filter *entity.StackFilter) ([]*entity.Stack, error)

func (*StackManager) MarkResourcesAsDeleted added in v0.13.0

func (m *StackManager) MarkResourcesAsDeleted(ctx context.Context, release *v1.Release) error

func (*StackManager) PreviewStack

func (m *StackManager) PreviewStack(ctx context.Context, params *StackRequestParams, requestPayload request.StackImportRequest) (*models.Changes, error)

func (*StackManager) ReconcileResources added in v0.13.0

func (m *StackManager) ReconcileResources(ctx context.Context, stackID uint, release *v1.Release) error

func (*StackManager) UpdateStackByID

func (m *StackManager) UpdateStackByID(ctx context.Context, id uint, requestPayload request.UpdateStackRequest) (*entity.Stack, error)

func (*StackManager) WriteResources added in v0.13.0

func (m *StackManager) WriteResources(ctx context.Context, release *v1.Release, stack *entity.Stack, specID string) error

type StackRequestParams added in v0.13.0

type StackRequestParams struct {
	StackID       uint
	Workspace     string
	Format        string
	Operator      string
	ExecuteParams StackExecuteParams
}

Jump to

Keyboard shortcuts

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