feat(stacks): support automated sync for stacks [EE-248] (#5340)
This commit is contained in:
@@ -2,6 +2,7 @@ package stackutils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"path"
|
||||
|
||||
portainer "github.com/portainer/portainer/api"
|
||||
)
|
||||
@@ -10,3 +11,12 @@ import (
|
||||
func ResourceControlID(endpointID portainer.EndpointID, name string) string {
|
||||
return fmt.Sprintf("%d_%s", endpointID, name)
|
||||
}
|
||||
|
||||
// GetStackFilePaths returns a list of file paths based on stack project path
|
||||
func GetStackFilePaths(stack *portainer.Stack) []string {
|
||||
var filePaths []string
|
||||
for _, file := range append([]string{stack.EntryPoint}, stack.AdditionalFiles...) {
|
||||
filePaths = append(filePaths, path.Join(stack.ProjectPath, file))
|
||||
}
|
||||
return filePaths
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user