stackutils

package
v0.0.0-...-270f78c Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Zlib Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrStackAlreadyExists     = errors.New("A stack already exists with this name")
	ErrWebhookIDAlreadyExists = errors.New("A webhook ID already exists")
	ErrInvalidGitCredential   = errors.New("Invalid git credential")
)

Functions

func DownloadGitRepository

func DownloadGitRepository(stackID portainer.StackID, config gittypes.RepoConfig, gitService portainer.GitService, fileService portainer.FileService) (string, error)

DownloadGitRepository downloads the target git repository on the disk The first return value represents the commit hash of the downloaded git repository

func GetStackFilePaths

func GetStackFilePaths(stack *portainer.Stack, absolute bool) []string

GetStackFilePaths returns a list of file paths based on stack project path

func IsValidStackFile

func IsValidStackFile(stackFileContent []byte, securitySettings *portainer.EndpointSecuritySettings) error

func ResourceControlID

func ResourceControlID(endpointID portainer.EndpointID, name string) string

ResourceControlID returns the stack resource control id

func SanitizeLabel

func SanitizeLabel(value string) string

convert string to valid kubernetes label by replacing invalid characters with periods

func UserIsAdminOrEndpointAdmin

func UserIsAdminOrEndpointAdmin(user *portainer.User, endpointID portainer.EndpointID) (bool, error)

func ValidateStackAutoUpdate

func ValidateStackAutoUpdate(autoUpdate *portainer.StackAutoUpdate) error

func ValidateStackFiles

func ValidateStackFiles(stack *portainer.Stack, securitySettings *portainer.EndpointSecuritySettings, fileService portainer.FileService) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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