stack

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: Apache-2.0 Imports: 24 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")
	ErrSourceNotFound                  = errors.New("the specified source does not exist")
	ErrWorkspaceNotFound               = errors.New("the specified workspace does not exist")
	ErrProjectNotFound                 = errors.New("the specified project does not exist")
	ErrInvalidStackID                  = errors.New("the stack ID should be a uuid")
	ErrGettingNonExistingStateForStack = errors.New("can not find State in this stack")
	ErrNoManagedResourceToDestroy      = errors.New("no managed resources to destroy")
	ErrDryrunDestroy                   = errors.New("dryrun-mode is enabled, no resources will be destroyed")
)

Functions

func BuildOptions

func BuildOptions(dryrun bool) *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 NewBackendFromEntity

func NewBackendFromEntity(backendEntity entity.Backend) (backend.Backend, error)

func ProcessChanges

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

Types

type StackManager

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

func NewStackManager

func NewStackManager(stackRepo repository.StackRepository, projectRepo repository.ProjectRepository, workspaceRepo repository.WorkspaceRepository) *StackManager

func (*StackManager) ApplyStack

func (m *StackManager) ApplyStack(ctx context.Context, id uint, workspaceName, format string, detail, dryrun bool, w http.ResponseWriter) (err 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, id uint, workspaceName string, detail, dryrun bool, w http.ResponseWriter) (err error)

func (*StackManager) GenerateStack

func (m *StackManager) GenerateStack(ctx context.Context, id uint, workspaceName string) (*v1.Spec, error)

func (*StackManager) GetStackByID

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

func (*StackManager) ListStacks

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

func (*StackManager) PreviewStack

func (m *StackManager) PreviewStack(ctx context.Context, id uint, workspaceName string) (*models.Changes, error)

func (*StackManager) UpdateStackByID

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

Jump to

Keyboard shortcuts

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