canonical / canonical/layer-basic

config states use hookenv.Config.changed, which can fail

Open
#67 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
10
Forks
42
PR merge metrics
No merged PRs in 30d

Description

The config states detect if a configuration item has changed using hookenv.config() and its changed method. This was designed assuming the only thing running in a hook context is a hook, which is now untrue. It is possible for an action to be invoked, which can check charm configuration using hookenv.config() and will flag changed config items as seen. If this action happens to be called between the config being changed and an actual hook being called (such as config-changed), then the configuration changed states will be lost.

The solution is for the base layer to cache the config itself in unitdata.kv(), so the cache only gets updated in charms.layer.basic.init_config_states()

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.