From 6b2df85c88c837599621adf44eaa2d82d437ec0c Mon Sep 17 00:00:00 2001 From: Jonas Kaninda Date: Sun, 24 Nov 2024 05:36:10 +0100 Subject: [PATCH] fix issue of extra configs as configMap: duplicated routes and middlewares in Kubernetes --- internal/extra_config.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/extra_config.go b/internal/extra_config.go index 4781e58..0903984 100644 --- a/internal/extra_config.go +++ b/internal/extra_config.go @@ -32,6 +32,10 @@ func loadExtraFiles(routePath string) ([]string, error) { if err != nil { return err } + // Skip hidden folders + if info.IsDir() && info.Name()[0] == '.' { + return filepath.SkipDir + } // Check for .yaml or .yml file extension if !info.IsDir() && (filepath.Ext(path) == ".yaml" || filepath.Ext(path) == ".yml") { yamlFiles = append(yamlFiles, path) @@ -40,7 +44,7 @@ func loadExtraFiles(routePath string) ([]string, error) { }) if err != nil { - return nil, fmt.Errorf("error loading extra route files: %v", err) + return nil, fmt.Errorf("error loading extra config files: %v", err) } return yamlFiles, nil }