use the base filename to check if the filename starts with a dot

This commit is contained in:
David Radcliffe 2017-04-28 12:24:39 -04:00
parent 11a6f190be
commit aa4fdf5907

View File

@ -22,6 +22,7 @@ package config
import (
"fmt"
"os"
"path/filepath"
"strings"
"github.com/golang/glog"
@ -81,7 +82,7 @@ func (s *sourceFile) watch() error {
func (s *sourceFile) processEvent(e *inotify.Event) error {
// 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)
return nil
}