use the base filename to check if the filename starts with a dot
This commit is contained in:
parent
11a6f190be
commit
aa4fdf5907
@ -22,6 +22,7 @@ package config
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
@ -81,7 +82,7 @@ func (s *sourceFile) watch() error {
|
|||||||
|
|
||||||
func (s *sourceFile) processEvent(e *inotify.Event) error {
|
func (s *sourceFile) processEvent(e *inotify.Event) error {
|
||||||
// Ignore file start with dots
|
// Ignore file start with dots
|
||||||
if strings.HasPrefix(e.Name, ".") {
|
if strings.HasPrefix(filepath.Base(e.Name), ".") {
|
||||||
glog.V(4).Infof("Ignored pod manifest: %s, because it starts with dots", e.Name)
|
glog.V(4).Infof("Ignored pod manifest: %s, because it starts with dots", e.Name)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user