You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a pretty nasty bug hidden in this layer. Here's how it goes, please bear with me :
render_without_context() is called (from the "main" charm, typically - filebeat in my case)
context = config() is run. context is now a reference to a Config object.
If you have set the logpath config option, then context['logpath'] = context['logpath'].split(' ') is run, which modifies context
Because the Config class constructor contains atexit(self._implicit_save) (and because the implicit_save class attribute of the Config class defaults to true), the modified context is saved to disk as the new config
When the next hook is run, the basic layer compares the current config and the config saved to disk, finds they're different, and sets the config.changed flag
This layer sets beat.render
The charm renders the config and restarts filebeat
I'm submitting a PR to fix.
The text was updated successfully, but these errors were encountered:
There's a pretty nasty bug hidden in this layer. Here's how it goes, please bear with me :
render_without_context()
is called (from the "main" charm, typically - filebeat in my case)context = config()
is run.context
is now a reference to a Config object.logpath
config option, thencontext['logpath'] = context['logpath'].split(' ')
is run, which modifiescontext
atexit(self._implicit_save)
(and because theimplicit_save
class attribute of the Config class defaults to true), the modifiedcontext
is saved to disk as the new configconfig.changed
flagbeat.render
I'm submitting a PR to fix.
The text was updated successfully, but these errors were encountered: