Skip to content

File Watch not triggering with Kubernetes ConfigMap changes #323

@jondavidnd1

Description

@jondavidnd1

Describe the bug
I've mounted a kubernetes ConfigMap containing a YAML file onto a directory. My application can successfully read the config from the file on startup using the file provider. However, when attempting the watch the file, updates to the ConfigMap (which are available when reading the file), are not triggering the file watch function.

Expected behavior
I would expect that changes to the ConfigMap would eventually trigger the watch function.

Please provide the following information):

  • OS: linux/kubernetes
  • Koanf Version - v2.1.1, providers/file version - v1.0.0

Additional context
viper had a similar problem that was addressed in this issue: spf13/viper#284. I believe the fsnotify event loop should be updated to compare the curPath with realPath, and if they are different, consider that an event that should trigger the watch function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions