mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
feat(edge-stack): per-device-configs-for-edge-stack EE-5461 (#9203)
This commit is contained in:
parent
76b871d8a0
commit
db61fb149b
8 changed files with 151 additions and 21 deletions
|
@ -11,6 +11,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/go-git/go-git/v5/plumbing/filemode"
|
||||
"github.com/portainer/portainer/api/archive"
|
||||
"github.com/portainer/portainer/api/crypto"
|
||||
gittypes "github.com/portainer/portainer/api/git/types"
|
||||
|
@ -491,6 +492,7 @@ func (a *azureClient) listFiles(ctx context.Context, opt fetchOption) ([]string,
|
|||
var tree struct {
|
||||
TreeEntries []struct {
|
||||
RelativePath string `json:"relativePath"`
|
||||
Mode string `json:"mode"`
|
||||
} `json:"treeEntries"`
|
||||
}
|
||||
|
||||
|
@ -500,7 +502,11 @@ func (a *azureClient) listFiles(ctx context.Context, opt fetchOption) ([]string,
|
|||
|
||||
var allPaths []string
|
||||
for _, treeEntry := range tree.TreeEntries {
|
||||
allPaths = append(allPaths, treeEntry.RelativePath)
|
||||
mode, _ := filemode.New(treeEntry.Mode)
|
||||
isDir := filemode.Dir == mode
|
||||
if opt.dirOnly == isDir {
|
||||
allPaths = append(allPaths, treeEntry.RelativePath)
|
||||
}
|
||||
}
|
||||
|
||||
return allPaths, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue