Commit 88a3b5ba authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #45111 from dwradcliffe/fix_kubelet_config_ignore

Automatic merge from submit-queue kubelet: use the base filename to check if the filename starts with a dot **What this PR does / why we need it**: Fixes a bug in https://github.com/kubernetes/kubernetes/pull/39196. The goal was to ignore files that start with a dot but the value used is the full absolute filename including path. **Which issue this PR fixes**: fixes #44450 @yujuhong **Release note**: ```release-note kubelet config should actually ignore files starting with dots ```
parents ff3a847d aa4fdf59
...@@ -22,6 +22,7 @@ package config ...@@ -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 { ...@@ -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
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment