Documentation
¶
Index ¶
- Variables
- func DownloadGitRepository(config gittypes.RepoConfig, gitService portainer.GitService, ...) (string, error)
- func GetStackFilePaths(stack *portainer.Stack, absolute bool) []string
- func IsGitStack(stack *portainer.Stack) bool
- func IsRelativePathStack(stack *portainer.Stack) bool
- func IsValidStackFile(stackFileContent []byte, securitySettings *portainer.EndpointSecuritySettings) error
- func ResourceControlID(endpointID portainer.EndpointID, name string) string
- func SanitizeLabel(value string) string
- func UserIsAdminOrEndpointAdmin(user *portainer.User, endpointID portainer.EndpointID) (bool, error)
- func ValidateStackFiles(stack *portainer.Stack, securitySettings *portainer.EndpointSecuritySettings, ...) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrStackAlreadyExists = errors.New("A stack already exists with this name") ErrWebhookIDAlreadyExists = errors.New("A webhook ID already exists") )
Functions ¶
func DownloadGitRepository ¶
func DownloadGitRepository(config gittypes.RepoConfig, gitService portainer.GitService, getProjectPath func() string) (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 ¶
GetStackFilePaths returns a list of file paths based on stack project path If absolute is false, the path sanitization step will be skipped, which makes the returning paths vulnerable to path traversal attacks. Thus, the followed function using the returning paths are responsible to sanitize the raw paths If absolute is true, the raw paths will be sanitized
func IsGitStack ¶
IsGitStack checks if the stack is a git stack or not
func IsRelativePathStack ¶
IsRelativePathStack checks if the stack is a git stack or not
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 ¶
convert string to valid kubernetes label by replacing invalid characters with periods
func ValidateStackFiles ¶
func ValidateStackFiles(stack *portainer.Stack, securitySettings *portainer.EndpointSecuritySettings, fileService portainer.FileService) error
Types ¶
This section is empty.