Ignore file start with dots

This commit is contained in:
Harry Zhang 2016-12-23 16:56:34 +08:00
parent b385a94fed
commit cba9a90fd1

View File

@ -22,6 +22,7 @@ package config
import ( import (
"fmt" "fmt"
"os" "os"
"strings"
"github.com/golang/glog" "github.com/golang/glog"
"golang.org/x/exp/inotify" "golang.org/x/exp/inotify"
@ -79,6 +80,11 @@ 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
if strings.HasPrefix(e.Name, ".") {
glog.V(4).Infof("Ignored pod manifest: %s, because it starts with dots", e.Name)
return nil
}
var eventType podEventType var eventType podEventType
switch { switch {
case (e.Mask & inotify.IN_ISDIR) > 0: case (e.Mask & inotify.IN_ISDIR) > 0: