kubernetes: kubelet should not pick up static pods from editor temp/backup files

When editing a kubernetes file in a folder watched by kubelet, editors often create a foo.yaml~ file. This file should be ignored by kubelet, ideally it would only search for *.{yml,yaml,json}

code

reproduction:

  • edit file
  • remove file
  • pod is still running because ~ version was picked up

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (10 by maintainers)

Most upvoted comments

bug is for example: edit file, remove file, pod is still running

I can work on a PR if we can agree on what to exclude. Currently, the issue is that you open a file for editing, and then a working copy of the editor is picked up by kubelet.

Probably, if we limit to .yaml/.yml/.json + release notes, it would be enough.

Impact might be lower when only excluding ~ and .bak extensions, but not sure that is the complete list of editor extensions. forcing file extensions seems like the better approach to me

When editing a kubernetes file in a folder watched by kubelet editors often create a foo.yaml~ file. This file should be ignored by kubelet, ideally it would only search for *.{yml,yaml}

currently any file with JSON or YAML content is supported, independent of the extension.

most users probably use .{yml|yaml} files, some probably use .json too, but there could be users with files without extensions, for whom this would be a breaking change. the change would need an action required release note at minimum.

/kind feature