diff --git a/pkg/transformer/kubernetes/k8sutils.go b/pkg/transformer/kubernetes/k8sutils.go index 61b940d24..649b4b52d 100644 --- a/pkg/transformer/kubernetes/k8sutils.go +++ b/pkg/transformer/kubernetes/k8sutils.go @@ -1247,7 +1247,7 @@ func isConfigFile(filePath string) (useConfigMap bool, readonly bool, skip bool) return } - if !fi.Mode().IsRegular() { // is dir + if fi.Mode().IsDir() { // is dir isDirEmpty, err := checkIsEmptyDir(filePath) if err != nil { log.Warnf("Failed to check if the directory is empty: %v", err) @@ -1275,7 +1275,7 @@ func checkIsEmptyDir(filePath string) (bool, error) { if !file.IsDir() { return false, nil } - _, err := checkIsEmptyDir(file.Name()) + _, err := checkIsEmptyDir(filepath.Join(filePath, file.Name())) if err != nil { return false, err }