From b4b44e6fa414804026c4e16eb417fd27313d7542 Mon Sep 17 00:00:00 2001 From: cmeng Date: Tue, 26 Sep 2023 13:49:25 +1300 Subject: [PATCH] fix(edge-config): allow empty filter type EE-5962 (#10381) --- api/filesystem/serialize_per_dev_configs.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/api/filesystem/serialize_per_dev_configs.go b/api/filesystem/serialize_per_dev_configs.go index b46637c98..c3f663c89 100644 --- a/api/filesystem/serialize_per_dev_configs.go +++ b/api/filesystem/serialize_per_dev_configs.go @@ -80,10 +80,14 @@ func shouldIncludeEntry(dirEntry DirEntry, deviceName, configPath string, filter return shouldIncludeFile(dirEntry, deviceName, configPath) } - // Include: - // dir entry A/B/C/ - // all entries A/B/C//* - return shouldIncludeDir(dirEntry, deviceName, configPath) + if filterType == portainer.PerDevConfigsTypeDir { + // Include: + // dir entry A/B/C/ + // all entries A/B/C//* + return shouldIncludeDir(dirEntry, deviceName, configPath) + } + + return false } func isInConfigRootDir(dirEntry DirEntry, configPath string) bool {