1
0
Fork 0
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:
cmeng 2023-07-14 06:41:47 +12:00 committed by GitHub
parent 76b871d8a0
commit db61fb149b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 151 additions and 21 deletions

View file

@ -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